count all files in a directory, recursively

Count files only:

find . -type f | wc -l

Count files and directories:

find . | wc -l

Count directories only:

find . -type d | wc -l

Now look at this:

~/.nuget$ find . -type f | wc -l
5259
~/.nuget$ find . | wc -l
10182

The .nuget folder has 5259 files. Even worse... it has almost as many directories as folders!

Source

results matching ""

    No results matching ""