Checking available and used disk space

Two useful terminal commands for checking disk usage in Linux, are the commands df and du.

The first command, df, provides a table of file systems with information on free and used disk space. Note: Using the -h option provides the table in a human readable format.

df -h

The second command, du, can also retrieve disk usage information. Typing du into any directory will provide a list of files and directories at the specified location with their corresponding disk usage. However du may be more useful with the options -s and -h providing a human readable summary of the specified location on disk.

eg. display disk usage for the current working directory

du -hs

or at a specified directory

du -hs directoryname

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