How to determine disk space usage?

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 }'
  • 10 Users Found This Useful
Was this answer helpful?

Related Articles

Connecting to your Linux VPS

Now you received your details you’ll connect to it via SSH if you have a Linux VPS: If your...

SSH is not working?

Please follow the steps below if SSH on your server is not working - Please make sure...

How to setup VPN server (PPTP on CentOS, RedHat and Ubuntu)?

This howto describes the steps in how to setup a PPTP VPN on Centos, Fedora, Debian, and Ubuntu...

How to install OpenVPN on Linux?

apt-get install openvpn openssl udev wget...

How to change root password on Linux VPS?

If you don't remember the password, please use the following steps for changing the root password...