Linux ls (maybe) help

Zach

Diamond Member
Oct 11, 1999
3,400
1
81
How do I find out how much disk space is being used by a directory?
 

Cyph3r

Senior member
Jan 20, 2000
790
0
0
Use the command "du". Go into the directory and type "du", or "du -s" to get just the total. I belive "du -k" will get you the size in kilobytes. Check out the man pages..Regards
 

Zach

Diamond Member
Oct 11, 1999
3,400
1
81
I've wondered this wfor a while, and it's weird that I haven't come accross it before. Oh well.. live and learn.
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
You don't have to cd into the directory to use du to see it's contents, just do du <directory name>. Part of what du does is cd to that directory. Also, I prefer the -h (human readable) it'll automatically do the K, M, G thang depending.
 

Zach

Diamond Member
Oct 11, 1999
3,400
1
81
I'm framilier with that. -h is what I usually use when doing df, which was happy to report that my / partition was 100% full today (made a backup of /etc/httpd, had to move it obviously). No wonder apache wouldn't start, with no reason to boot. Hence why I want to see how big the duirectories are..