Skip to content

Instantly share code, notes, and snippets.

@clivewalkden
Last active November 9, 2017 14:42
Show Gist options
  • Save clivewalkden/1004c4b52790d6fcd597ccdc3b03ad96 to your computer and use it in GitHub Desktop.
Save clivewalkden/1004c4b52790d6fcd597ccdc3b03ad96 to your computer and use it in GitHub Desktop.
Track down server disk space hogs
# Get the size of all the directories in the root sorted by size (MB)
du -sm /* | sort -n
# To exclude the /home directory (or other partitions not included in the space calculations) use --exclude=/home/
du -sm /* --exclude=/home/ | sort -n
# Drill down to the offending directories
# These are normally
# /var/log
# /var/lib/mysql
# /usr/local/cpanel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment