[ale] Inode count in directory

Nate Murchison nate.murchison at gmail.com
Sat Feb 13 15:25:11 EST 2010


On Fri, Feb 12, 2010 at 6:28 PM, Jim Popovitch <jimpop at gmail.com> wrote:
> On Fri, Feb 12, 2010 at 17:56, Brandon Checketts
> <brandon at brandonchecketts.com> wrote:
>> I have an OpenVZ instance that claims to be out of inodes.  I could just
>> increase the limit, but I'd like to see where all of them are being
>> used.  Does anybody know how to count the number of inodes in a
>> directory, similar to 'du -sm *' ??  I suppose some combination of 'ls
>> -i' and 'wc' might work, but my brain has about stopped working for the
>> week, and I'm thinking that there must be an easier way
>
>
> http://lmgtfy.com/?q=count+inodes+in+a+directory
>
> -Jim P.
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>

The URL above is a cute and flippant use of google to return links to
answers that are ironically wrong.  The first link returned by google
points to a site that uses a script that breaks immediately when given
a directory name that begins with a comma as an argument (
http://fieldsmarshall.com/how-to-count-inodes-for-each-directory/ ),
the second suggests a script that fails to take hard links in a
directory into account  (file /a/b and /a/c may be the same inode with
two directory entries).   The Brandon Checketts probably assumed that
he would get a better (either more correct or more helpful) answer
from ale than from google.  Oh well.

-- 
Nate Murchison
Chief Technology Officer
American Fire and Bomb, L.L.C.



More information about the Ale mailing list