Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As the title stated, I'm getting a drive warning via email from my server. I was told to use the following command to determine where the disk space usage is coming from. Is it possible for me to sort the results based on disk usage? It returns a long list that is hard to sort through...

du -h --max-depth=2 /usr

Update:

What kind of data is stored here?

share|improve this question

1 Answer 1

up vote 4 down vote accepted
du --max-depth=2 /usr | sort -n | less

sorts the output and less allows to scroll up again

share|improve this answer
1  
Also the -b option to du will give you bytes used. –  Andrew Jul 24 '10 at 12:53
    
Add the "-h" option to get human readable in MegaBytes –  John Jul 24 '10 at 16:40
    
can sort handle the abbreviations? –  krissi Jul 24 '10 at 17:20
    
No. If you're passing it into sort, then don't use -h. Use -b, -k or -m. –  Bill Lynch Jul 24 '10 at 18:06
    
That just outputs blank lines... –  Webnet Jul 28 '10 at 12:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.