Categories
guides

Count Files in Folder (including Subfolders)

To count the number of files in a folder (including its subfolders, pipe the output of a find command to the wc (word count) command.

# From base folder
find . -type f | wc -l

The -type f switch on find tells it to only find files. The output of this is one file per line.

The -l switch on wc tells it to count lines instead of words

By bo.

I'm @boyEatsSteak in a lot of places. I have been wanting 🍕 for weeks. I like gadgets and technology and keeping notes and tips for my future self since all I can remember is that I forget things.