How to find how much disk space a directory is consuming in Linux
The Linux command line utility “du” (disk usage) tells you how much space a file or a directory is taking on the disk. Just run the command against a file or a directory. If a directory is specified it determines disk space used by all files and sub directories recursively. By default it displays number in KB (kilo bytes) and the option “-h” makes it show the sizes in human-readable format.
You might be wondering what is the use of “du” command against a single file as “ls -l” on any file shows the size of that file. The actual disk space used by a file could be more than actual size of the file shown in “ls -l“. Take a look at the following example where a file uses 4KB disk space while its original size is 12 bytes.