How to get a Disk Usage Breakdown — VPS and Dedicated

If you are running out of disk space on your account, it may be wise to find out what’s taking up so much space.  This way you can clean up your usage and manage your account better.  You’ll need to log into your system console as the root user.

One you are logged in as the root user change your directory to / instead of the root user directory.  Type:

cd /

Now go ahead and run this command to get a overall breakdown of your account:

df -H


That command gives you an overview of your account.  Now to get a full break down of your disk usage and to sort it, run this command:

du -chs /* | sort -h


This gives you a pretty good breakdown of what’s on your server.  The ones you want to pay attention to are /var (you databases and some logs) /backup (your backups) and /home (you email and website files).  Now if you want a breakdown of a specific directory, go ahead and just change the /* for the directory path.  For example:

du -chs /backup/* | sort -h

du -chs /backup/cpbackup/* | sort -h

du -chs /backup/cpbackup/daily/* | sort -h


You can do that with which ever directory that you would like a better breakdown of.

Posted in Archived Posts and tagged .