help with getting directory sizes

stevedave

Supreme [H]ardness
Joined
Mar 6, 2007
Messages
5,737
so I use ( du -s ) to get the directory size.

But what do I do to get sub directory sizes?

So I have 50 folders underneath my Default folder and I don't want to go through each folder and have to type du -s default/project1 for every single folder. Is there a way to get all the directories under Default and have it listed like below.

Default/project 1 - size
Default/project 2 - size
Default/project 3 - size

Thanks,
 
du --max-depth=

Code:
eeyrjmr@FluidServer ~ $ du --max-depth=1 -h
488K    ./.irssi
2.5G    ./documents
32K     ./.elinks
4.0K    ./.bash_completion.d
60K     ./IRCbot
28K     ./.ssh
2.5G    .
 
cool that worked.

Also du -sh * within the directory worked as well. Don't use unix enough to remember all the commands off hand and it is a hard thing to google and get the answer you are looking for.
 
You don't need google, man pages are your friend. :D
 
Back
Top