How to determine disk space usage? Print

  • 13

To check what is taking up space on your server, you can run multiple commands -
  • You can use the du command -
    • du -kscx *
    • du -hc --max-depth=4 /dir | sort -h
  • You can also try the ncdu utility found at: http://dev.yorhel.nl/ncdu
  • Another option is to use the find command -
    • find /home/ -size +1073700000c -print
  • The following command will display all files and folders sorted by MegaBytes
    • du --max-depth=1 | sort -n | awk 'BEGIN {OFMT = "%.0f"} {print $1/1024,"MB", $2}'
  • Below is the "find"command that looks for specific files in the "home" directory. The following script is finding files that are 500000k or larger
    • find /home -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Was this answer helpful?

« Back
  • US/Canada: 800-933-1517
  • International: 626-549-2801