1

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?

1 Answer 1

4
du --max-depth=2 /usr | sort -n | less

sorts the output and less allows to scroll up again

5
  • 1
    Also the -b option to du will give you bytes used.
    – Andrew
    Jul 24, 2010 at 12:53
  • Add the "-h" option to get human readable in MegaBytes
    – John
    Jul 24, 2010 at 16:40
  • can sort handle the abbreviations?
    – krissi
    Jul 24, 2010 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, 2010 at 18:06
  • That just outputs blank lines...
    – Ben
    Jul 28, 2010 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .