How can I get the number of inodes used by files in a given directory tree?
Important: including hidden directories under it, like .git
Asked
Active
Viewed 1,282 times
1 Answers
5
As found on How do I count all the files recursively through directories
find . -printf '%i\n' | sort -u | wc -l
Or if you don't have GNU find and need a portable version:
find . -exec ls -id '{}' \; | awk '{print $1}' | sort -u | wc -l
-
solaris wont like that because of the multiple spaces before the inode number, you also need to uniquely sort before counting lines, as im sure you know.
find . -exec ls -id {} \; |awk '{print $1}' | sort -u | wc -l
– Sirch May 24 '13 at 11:51 -
find .
exclude those? – ptman May 24 '13 at 10:13