4

Possible Duplicate:
How to understand what's taking up space?

What's a good command line utility/script to analyze a folder structure and find out what's taking up all the space? The granularity of df is way to large.

Specifically I'd like something that can run with limited permissions (e.g. on shared hosting) I seem to be running on Redhat, if that matters.

ripper234
  • 31,063
  • 43
  • 82
  • 90
  • 2
    Er...[didn't you ask this a year ago?](http://unix.stackexchange.com/questions/3961/how-to-understand-whats-taking-up-space) – Michael Mrozek Nov 10 '11 at 20:30
  • 1
    @MichaelMrozek - I vaguely remembered something like that. Now next time I'll be able to find one of these questions. Sorry for not looking too hard, I was in the "fire question away" mood. – ripper234 Nov 10 '11 at 21:23
  • ncdu ncdu ncdu ncdu – user84207 May 17 '23 at 19:58

1 Answers1

5

It's not a treemap (which I agree can be nice), but du will give you a breakdown by directory. Look into the -d option, to only show a certain level of depth.

Also note that you can sort the output, but you should use -k or similar, otherwise '1M' will sort before '2K' - probably not what you want.

Example: show size summary for all directories in current directory:

du -d 1 .
jwd
  • 1,282
  • 8
  • 12
  • 3
    If you haven't seen ncdu you should check it out as it is even better for large scans where you wish to be able to drill down: http://unix.stackexchange.com/a/3964/13779 – Gerry May 22 '16 at 16:36