Find largest directories on linux. Analyse disk space usage

By neokrates, written on November 18, 2011

howto

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
Ad
Poll
  • The setup of your CI environment is?

    • We don't use CI (100%, 8 Votes)
    • Just CI tool located on one of our developers computers (0%, 0 Votes)
    • Dedicated server for single CI tool (0%, 0 Votes)
    • Dedicated servers with independent CI instances (0%, 0 Votes)
    • Dedicated servers for master-slave configuration of CI (0%, 0 Votes)
    • Many CI setups distributed through teams (de-centralized setup) (0%, 0 Votes)
    • We use external cloud for builds (0%, 0 Votes)
    • Different setup (0%, 0 Votes)

    Total Voters: 8

    Vote

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:

Where is all my linux disk space? What used all my disk space? du command has many useful options to analyze the disk usage.

The following method allows to track down the “biggest offenders”, directories which take most space in, more then GB, then hundreds MB..

I used two additional options here :
-hx /
-h = human readable, prints G or M sizes.
-x / says to stay on the same device, in this case root device.

You can skip -x / if you analyze all mounted devices.

100 dirs with size over Gb:

> du -hx / |grep ^[0-9.]*G | sort -rn| head -n 100 

10 dirs with size over Gb:

> du -hx / |grep ^[0-9.]*G | sort -rn| head -n 10 

10 dirs with size over M:

> du -hx / |grep ^[0-9.]*M | sort -rn| head -n 10 

This way, you can get a list of dirs, first more then Gb big, then largest Mb dirs.
Such list can be sorted, grepped, etc, to find the root cause of you hard disk problems …

Here are more commands to try :
http://stackoverflow.com/questions/32230/tracking-down-where-disk-space-has-gone-on-linux

 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: +2 (from 2 votes)
2 votes 'YES'  0 votes 'NO'

LEARN MORE (amazon bookstore)

TAGS

RELATED
Pages
Posts
    nope :(

SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

INCOMING SEARCH TERMS


Leave a Reply