LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   inode count (https://www.linuxquestions.org/questions/linux-general-1/inode-count-712355/)

hybernate20 03-17-2009 05:38 PM

inode count
 
Hello,

I was wondering if anybody knows of a way to find out what the inode usage is for a particular folder. I know that you can check it with a df -i for an entire FS, but that doesn't really help me. Any ideas?

anomie 03-17-2009 05:46 PM

A goofy hack off the top of my head:
Code:

%find some_folder -type f -exec ls -i {} \; > my-output
%awk '{print $1}' my-output | sort | uniq | wc -l

The sort/uniq combo is there to squeeze out duplicated instances of hard links. There may be a more elegant solution than this. ;)


All times are GMT -5. The time now is 10:46 PM.