Operating System - HP-UX
1834264 Members
77238 Online
110066 Solutions
New Discussion

size of directory with sub directories below it.

 
SOLVED
Go to solution
Ratzie
Super Advisor

size of directory with sub directories below it.

I need to find the size of a directory that is not a mount point. So bdf is useless.

This directory has files and directories below it.
If I do an du -sk /var/dir it returns the defualt size of 8192
I know with files and other directories it is quite huge.

I want to create its own logical volume and need to know had to size it.
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: size of directory with sub directories below it.

du -sk should do it.

# du -sk /var/tmp
32 /var/tmp

Tells me that /var/tmp and anything below amounts to 32K.


Pete

Pete
Sandman!
Honored Contributor
Solution

Re: size of directory with sub directories below it.

du -ks should be all you need unless you are doing this on an nfs mount point.

cheers!
Mel Burslan
Honored Contributor

Re: size of directory with sub directories below it.

8192 in your case may not be the default size, but actually the 8MB worth of data accumulated under this directory. Did you try copying another huge file into this directory to see if this size changes or not ?

Otherwise du -sk /directory/name does the magic for me all the time.
________________________________
UNIX because I majored in cryptology...
Ratzie
Super Advisor

Re: size of directory with sub directories below it.

Thanks everyone