Wednesday, January 31, 2007

Counting number of files in the current Directory/sub Directory


Ah, this is very simple, one might think why I am putting this in my blog.
Could be a help for a BASH newbie :-)

$ ls -RF1 | grep -v $"[/,:]" | grep -v ^$ | wc -l
11

$ find . -type f | wc -l
11

No comments:

© Jadu Saikia www.UNIXCL.com