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.

2 comments:

Leave a Reply

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