Linux: Which directory has the most files?

An inode is used for every file in the filesystem. If the system is running out of inodes that means there are some directories with a lot of files in them.

The following command will find the directories with most files.

find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n

The following command list free inodes on all filesystems

df -hi

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s