Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

du - Shows the disk space a file or directory is using in your disk

Date: 2008-06-21 00:00:00 -0400

This is a very useful command you may use to find which file or directory is filling you disk.

So if you need to check the file and directory size in your home directory you can enter

cd

to switch to your home directory

du -S * | sort -n

This is going to list all files, directiries and sub-directories in size order, and will not include sub-directories' size in directories' size, if you want to have a total size of a directory including its sub-directories, you will have to remove the -S

du * | sort -n

If you want to have the sizes in "human language" I mean in kilos and megas, add the -h parameter.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.