How to find areas of disk usage with SSH
This article will show you how to locate areas of disk usage within your Virtual Private Server.
Running out of space on your VPS and not sure why? By following the steps outlined below, you can see which directory your memory is being used on along with any particularly large files.
Please note: the following article was originally created for our current generation of Virtual Private Servers. As such, these instructions may not be relevant to our previous generation of Virtual Private Servers.
Important: you will need to enable admin access to your server to perform this action. As such, we only recommend that advanced users undertake this action as changes to your system files are irreversible and can cause your associated websites to go offline.
Start by logging in to your server via SSH.
Next, you will need to switch to the root user.
From there, enter the command df -h to see an overview of how much disk space is available on your server.
If you want to find any files that are more than 500MB large, simply enter the following command:
find / -type f -size +500M -exec du -h {} + 2>/dev/null | sort -h
Similarly, if you want to find any large directories, enter this command:
[root@server /]# du -Sh / | sort -h | tail -10