Last active
October 16, 2015 08:38
-
-
Save ianhomer/5d7d22544ce0871d3599 to your computer and use it in GitHub Desktop.
Diskspace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If syslog is big then you can rotate log and then clear up | |
savelog -g adm -m 640 -u root -c 7 /var/log/syslog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get summary | |
df -m | |
# Size of top level directories in Mb in alphabetical order (so you can see if any take a long time to process) | |
ls / | sort | |
ls / | sort | grep -v "usr" | xargs -n 1 du -m -d 0 2>/dev/null | |
ls . | sort | grep -v "usr" | xargs -n 1 du -m -d 0 2>/dev/null | |
( cd /opt/mydirectory ; ls . | sort | grep "id" | xargs -n 1 du -m -d 0 2>/dev/null | sort -n ) | |
# Then drill into each | |
du -ma -d 1 /home 2>/dev/null | sort -rn | |
du -ma -d 1 /lib 2>/dev/null | sort -rn | |
du -ma -d 1 /usr 2>/dev/null | sort -rn | |
du -ma -d 1 /var 2>/dev/null | sort -rn | |
du -ma -d 1 /tmp 2>/dev/null | sort -rn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment