Counting Files (Recursively)

I needed to find this command lately, so figured I would post it here.

ls -Ra1 /usr|grep -v /|grep -vx ""|grep -vx "\.*"|wc -l

Or if you don’t want to include hidden files

ls -R1 /usr|grep -v /|grep -vx ""|grep -vx "\.*"|wc -l

Worked great for me!

Source: http://www.linuxforums.org/forum/miscellaneous/30943-counting-all-files-directory-subdirectories.html Image Source: http://www.squidoo.com/countvoncount

Comments are closed