get directory size

Hi,

How to get size of particular directory?

Thanks

man man du (OpenSolaris)

Try du -k directory_name

this show the size in KB.

du -m dir_name

for viewing in MB

Hope it helps..

du -h /tmp/ | tail -1

Since last line of du gives sum of dir content size i.e. size of dir

technically it's not the size of a directory. :rolleyes: you should also use the -s option. there is no reason to pipe to tail.

hi ,

# du -sh dir_name

bye!