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…
- Show the 50 largest files…
find / -path '/proc' -prune -o -size +1000k -printf '%s %p\n' | sort -k1 -g -r | head -50 - Show the 50 largest directories (excluding files in subdirectories)…
du -kS / | sort -k1 -g -r | fgrep -v '/proc' | head -50 - 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.
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.
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).
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.
Good stuff for systems administrators.
I’ve add you blog to my bookmarks.
Thanks.!
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….