Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Check a disk usage summary to find wasted disk space using bash' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Check a disk usage summary to find wasted disk space using bash
Authored by: dirkwald on Oct 10, '03 11:46:56AM
If you use bash as your shell (default in Panther IIRC), the command
alias dus='du -Psckx * | sort -nr'
should be added to your ~/.bash_profile.

[ Reply to This | # ]
Check a disk usage summary to find wasted disk space using bash
Authored by: gustou on Oct 10, '03 12:44:03PM

It also seems that
alias dus 'du -Psckx * | sort -nr'
doesn't work on Panther. you should get rid of the P option :)

You can also add the "h" option to du to have a Human readable output.
So it becomes :
alias dus 'du -sckxh * | sort -nr'
Enjoy !



[ Reply to This | # ]
Check a disk usage summary to find wasted disk space using bash
Authored by: foobar104 on Oct 10, '03 12:56:23PM

Don't use du -h and sort -n at the same time. The -n option to sort tells it to sort numerically, but the -h option to du keeps it from returning a number. If you du -h and sort -n, you end up with a list that puts 12K in front of 11G, which isn't what you wanted.



[ Reply to This | # ]
Check a disk usage summary to find wasted disk space using bash
Authored by: bluehz on Oct 12, '03 07:14:55AM

I believe the "P" option is relative to the version of du you have installed. The "P" option is not available for me in Jaguar running du version 4.1 installed via Fink.



[ Reply to This | # ]