[ale] Inode count in directory

Lightner, Jeff jlightner at water.com
Mon Feb 15 08:51:32 EST 2010


A directory name that begins with a comma *shudder* - I can imagine many things that would break on something like that and can imagine very few GOOD reasons to use such a name.  (I can imagine reasons that PHBs might come up with but none of them would be GOOD in my estimation.)

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Nate Murchison
Sent: Saturday, February 13, 2010 3:25 PM
To: Atlanta Linux Enthusiasts - Yes! We run Linux!
Subject: Re: [ale] Inode count in directory

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.

_______________________________________________
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
 
Proud partner. Susan G. Komen for the Cure.
 
Please consider our environment before printing this e-mail or attachments.
----------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------



More information about the Ale mailing list