Is there any functional keyword which able to display the progress in percentage when I do "find" or "grep" command? For example, when I do "wget" command, I can see the percentage when downloading.
Asked
Active
Viewed 569 times
1
-
1You could pipe through a progessbar like [bar](http://stackoverflow.com/questions/238073/how-to-add-a-progress-bar-to-a-shell-script) or [Pipe viewer](http://www.ivarch.com/programs/pv.shtml), but what are the 100% of find? related Question: http://serverfault.com/questions/341143/linux-find-command-show-progress – pce Apr 29 '14 at 11:40
-
1A percentage with `wget` makes sense: there is a known number of bytes coming, and you can count how many of them have arrived so far. What would you display for `find` and `grep`? – chepner Apr 29 '14 at 11:40
-
Because I want to let client know how much source has gone through within the directory, therefore client does not need to guess. sometimes it just hanging on searching. So I decided to show progress bar, meanwhile list the matched files. For example, virus scanning application is the one. – taymedee Apr 29 '14 at 12:25
-
1@taymedee In order to do that, you would have to run the search twice - once to find out how big the haystack is so that you can calculate percentages on the second run, and then a second time to do your actual search, displaying progress as you go. So, say your search takes 10 minutes - your user would wait 10 minutes before seeing that you are starting at 0%, and another 10 minutes to get to 100%. I suspect this is not really what you want... – twalberg Apr 29 '14 at 14:27
1 Answers
0
There is the great pv
("pipe viewer") which you can inject into a pipe to monitor progress.
However, as @chepner points out there is probably little point in using it with find
or grep
since you have no size to relate to.

Adrian Frühwirth
- 42,970
- 10
- 60
- 71