[NTLUG:Discuss] Re: Is there a command line utility which will report directory statistics?

Leroy Tennison leroy_tennison at prodigy.net
Fri Jan 20 05:54:52 CST 2006


Graham Wilson wrote:

>On Thu, Jan 19, 2006 at 06:20:47AM -0600, Leroy Tennison wrote:
>  
>
>>Such things as number of files,
>>    
>>
>
>find $dir -type f | wc -l
>
>  
>
>>number of subdirectories,
>>    
>>
>
>find $dir -type d | wc -l
>
>  
>
>>size? 
>>    
>>
>
>du
>
>  
>
Thank you, that's exactly what I needed and would have never found by 
searching.  A couple of questions:

Where is $dir documented?  I thought it was a reference to a BASH shell 
variable but couldn't find either 'dir' or 'DIR' using "set | less". 
 Googling and trying Yahoo proved futile because both interpret the $ 
somehow.

Second, I take it that 'du' reports only in blocks rather than actual 
aggregates of sizes even if the '-b' switch is used, correct?  The 
reason I ask is that I'm looking for an equivalent of what the Evil 
Empire does when it calculates directory sizes.

Again, thanks for the help.






More information about the Discuss mailing list