Checking Disk Usage (*nix)

Brazenly lifted from 

http://kb.mediatemple.net/questions/916/Managing+your+disk+usage

 

View Disk Space from SSH

To check your Total Disk Usage for your entire server via SSH you can type the following:

 

 

The first column displayed is the device. The next three columns show the total size, the amount used, and the amount available

 

TIP: 

  • You can use -m for megabytes
  • You can use -k for kilobytes 

 

Another useful command is du. Running this command will list all directories with their filesize from your current directory.

 

A good example of using this command would be to view the sizes of your site’s directories:

 

NOTE: 

Remember to replace mt-example.com with your domain name.

 

 

To show the total directory size of the current directory you can run the following command:

 

To show directory sizes as a listing you can use the command:

 

Searching for Large Files

You can use the following command to search for files over 10MB in size:

 

NOTE: 

To adjust the size of your search replace +10000k with the size you desired, such as the following: 

  • 50MB: +50000k 
  • 100MB: +100000k 
  • 500MB: +500000k 

 

 

Leave a Reply

Your e-mail address will not be published. Required fields are marked *