Where are all my inodes being used? Where are all my inodes being used? unix unix

Where are all my inodes being used?


If you don't want to make a new file (or can't because you ran out of inodes) you can run this query:

for i in `find . -type d `; do echo `ls -a $i | wc -l` $i; done | sort -n

as insider mentioned in another answer, using a solution with find will be much quicker since recursive ls is quite slow, check below for that solution! (credit where credit due!)


Provided methods with recursive ls are very slow.Just for quickly finding parent directory consuming most of inodes i used:

cd /partition_that_is_out_of_inodesfor i in *; do echo -e "$(find $i | wc -l)\t$i"; done | sort -n


So basically you're looking for which directories have a lot of files? Here's a first stab at it:

find . -type d -print0 | xargs -0 -n1 count_files | sort -n

where "count_files" is a shell script that does (thanks Jonathan)

echo $(ls -a "$1" | wc -l) $1