On Linux, to find the number of files (inodes) in a directory:

$ find ./ | wc -l

to find the number of files (not directories) in a directory:

$ find ./ -type f | wc -l

to find the number of directories in a directory:

$ find ./ -type d | wc -l

Similar Posts

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *