Quick Tip: Disk Usage in Terminal

When investigating your disk usage, there are two simple terminal commands which can make your life easier.

The first command df, provides a usage report for your file system, providing a list of partitions and the amount of space which has been used and how much space is available in each.

eg. df

Another command that can provide more specific information on disk usage is the du command. This command will provide a list of each file and directory and the amount of disk spaced used by each, with the total disk usage for the specified directory/file provided at the end of the output.

eg. du /home

Like most terminal commands, a number of arguments can be used in conjunction. One very useful argument is the -h argument, which provides the output of both commands in a human readable format. An examples of using this argument can is shown below,

df -h
du -h /home

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s