How To Identify the Files/Directories Chewing Up Disk Space Under Linux

If you are running out of disk space under Linux, here are three useful commands to help identify which files and directories are chewing up the most disk space…

  1. Show the 50 largest files…find / -path '/proc' -prune -o -size +1000k -printf '%s %p\n' | sort -k1 -g -r | head -50
  2. Show the 50 largest directories (excluding files in subdirectories)…du -kS / | sort -k1 -g -r | fgrep -v '/proc' | head -50
  3. Show the 50 largest directories (including files in subdirectories)…du -k / | sort -k1 -g -r | fgrep -v '/proc' | head -50

Important: As these commands may take a little while to run, you should not run these commands on a production system where a significant increase in load would have an adverse impact.

5 Responses to “How To Identify the Files/Directories Chewing Up Disk Space Under Linux”

  1. Paul Betts says:

    Another handy tool for finding disk size problems on a desktop machine is Filelight (http://www.methylblue.com/filelight/), which displays disk usage as a map of concentric rings that is really intuitive to read and understand.

  2. anonymous says:

    It is spiffy to show your shell incantation.. but there is not even the shortest explanation of how the commands break down and what they do. More experienced folks may say Ah, I see what he did and remember. But the newer folks are going to either copy it verbabim to use once in a while or forget it completely, if they don’t understand the individual commands (much less piping).

  3. Kent Johnson says:

    A fair critique although my goal is not to explain how piping works or even to explain the mechanics of how it works — this is just provided to use verbatim if anyone else finds it useful.

  4. logadmin says:

    Good stuff for systems administrators.
    I’ve add you blog to my bookmarks.
    Thanks.!

  5. JESSE says:


    Pillspot.org. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. Online Pharmacy. Order drugs online

    Buy:Cozaar.Female Pink Viagra.Zocor.Female Cialis.Benicar.Wellbutrin SR.Advair.Aricept.Amoxicillin.Buspar.Zetia.Lipothin.Ventolin.Lipitor.Lasix.Prozac.Seroquel.Nymphomax.Acomplia.SleepWell….

Leave a Reply