Finding the Number of Files (inodes) in a Directory on Linux

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

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.


  1. Number of inodes != Number of files

    As in, you can’t guarantee 1 file uses 1 Node!!!!!!!!!!!

Leave a Reply

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