Apr 19 2014 
Support Center » Knowledgebase » Linux VPS » How do I find where all of the space my VPS is using is at?
 How do I find where all of the space my VPS is using is at?
Solution There are many times in which you may be interested in finding out where all of the space on your VPS is being used at. Linux includes the "du" tool to help make this quick and easy to estimate disk usage.

Switch to your root folder. Use the following command to do so:

cd /

After switching to the root folder, you can use the following command to see your disk usage:

du -h --max-depth=1

Lets break this command down a little bit. "du" is the main command to give a disk space break down. The "-h" switch gives you the output in a human readable format (in KB, MB, or GB instead of in just bytes). The "--max-depth=1" switch tells the command to just give the report for one level deep. The space for all folders below that level are still counted, but the sub folders themselves are not displayed.

When the command is run, you would see something displayed like the following:

[root@server05 /]# du -h --max-depth=1
3.8M ./bin
2.0K ./boot
30K ./dev
3.7M ./etc
9.0K ./home
1.0K ./initrd
16M ./lib
1.0K ./mnt
1.0K ./opt
39K ./package
0 ./proc
191M ./root
5.0M ./sbin
1.0K ./selinux
1.0K ./sys
1.0K ./tmp
1.0K ./tmp_logrotate
972M ./usr
255M ./var
1.5G .

The last line will give you the total space used for all folders it counted. In this case, the total disk space usage on this server right now is 1.5GB. Of that amount, 972MB of space can be found in the /usr folder.

So lets say we think that amount is a little high and want to find out a little more detail about the usage inside that folder. So switch to the /usr folder.

cd /usr

Run the earlier command again to see the usage inside of that folder.

du -h --max-depth=1

You should then see the space inside of the /usr folder.

[root@server05 usr]# du -h --max-depth=1
6.7M ./X11R6
98M ./bin
1.0K ./etc
1.0K ./games
19M ./include
3.0K ./java
37K ./kerberos
390M ./lib
39M ./libexec
26M ./local
21M ./sbin
375M ./share
14K ./src
972M .

The above commands can be used for finding the space usage of any folder and the files below it.

Article Details
Article ID: 82
Created On: Jan 23 2009 04:04 PM

 This answer was helpful  This answer was not helpful

 Login [Lost Password] 
Remember Me:
 Article Options
Home | Register | Knowledgebase

Help Desk Software By Kayako eSupport v3.60.02