Wednesday, January 2, 2013

Hard disk usage from command line on Linux


$ df -h -T

The df utility displays the disk space usage on all mounted filesystems.
The -T option prints the filesystem type as well.
By default, df measures the size in 1K blocks, which could be a little difficult for a desktop user to decipher.
Use the -h option to get more understandable output.

--------------------------------------
If you want the size of an particular directory, specify it with du directoryname. For instance,
$ du -h /home/

$ du -ah | sort -n
Here we’ll check the disk usage of the current directory, and display all file names with their disk usage, and then sort them numerically using the sort utility.

--------------------------------------

http://www.geekyboy.com/archives/133

No comments:

Post a Comment