Try this instead ( find -printf support required):
find <expr> -type f -printf '.' | wc -c
It will be more reliable and faster than row counting.
Note that I am using find printf and not an external command.
Say a little:
$ ls -1 a e l ll.sh r t y z
My sample excerpt:
$ time find -type f -printf '.' | wc -c 8 real 0m0.004s user 0m0.000s sys 0m0.007s
With full lines:
$ time find -type f | wc -l 8 real 0m0.006s user 0m0.003s sys 0m0.000s
So my solution is faster =) (the important part is the real line)
Gilles Quenot Mar 27 '13 at 16:14 2013-03-27 16:14
source share