Recursively count the number of files on a Linux server

Simple script to recursively count the number of files on a Linux server.

ls -laR | wc -l

How this works:

ls (lists folder contents), -l (long listing format), -a (all), -R (recursive)
wc (word count), -l (or –lines, prints only the newline counts)

Leave a Reply