Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

with the command

du -sh *

I get the summary of files in MB,GB, etc. If I use

du -s * | sort -nk1

I get the summary sort by size.
How I can get the summary sort by size in MB, GB, etc?

Edit

the OS is ubuntu

share|improve this question
3  
You didn't mention the OS and/or version of sort you're using. If it's GNU sort replace the -n with a -h. So "du -sh * | sort -hk1,1" –  tink Dec 17 '12 at 19:04
    
@tink you comment solve the question –  juanpablo Dec 17 '12 at 19:16
    
Now I wish I had made it an answer ;D –  tink Dec 17 '12 at 19:25
    
@tink with you comment make a answer for close this question :) –  juanpablo Dec 17 '12 at 19:29

1 Answer 1

up vote 2 down vote accepted

If you're using GNU sort, try the following:

du -sh * | sort -hk1,1
share|improve this answer

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.