Tracking Your Linux Disk Usage

It’s always important to keep track of how much free space you have on your PC.  For Windows, there are three programs I am aware, off the top of my head – SpaceMonger, WinDirStat, and Overdisk.

For Linux, the command line is probably simpler, at least to show total disk usage.  The du command shows how much disk space is used.  Consider the following examples:

sudo du -h –max-depth=0 /

The above shows how much disk space is used by the whole filesystem.  The -h parameter shows a human-readable format, e.g. 500M, 2G.  The -max-depth parameter prints the total for a directory or file or n or fewer levels below the command-line parameter.

sudo du -ch –max-depth=1 /

-c prints a grand total, the max-depth of 1 means that each directory under root will be printed with a total disk usage following it.

Play around with other parameters to see what you get or tweak your results.

Here is a link to a man page for du

http://linux.die.net/man/1/du

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


%d bloggers like this: