checking disk space using df and du

August 31st, 2006 mysurface Posted in Common, df, du | Hits: 82952 | 5 Comments »

The common way to check for all partition disk space, how much is still remain, you can simple use

df -h

Usually I will put -h to make it size human readable.

Another good tools to check the disk space for directories, we use du. You may realized that when you type ls -l, the size of every directories have the same size 4096, it is because directories is actually a file. But for us, we want to know how large the load it store instead the directory file itself.

To show all directories size including sub directories, type

du -h

To calculate the current directory size you are in (-s stand for summary)

du -sh

To show all the 1 level sub directories size (which you are not interested at sub sub directories.)

du -sh *

To show the size of specific directory

du -sh /home

To show the size of all sub directories of a specific directory

du -sh /home/*

5 Responses to “checking disk space using df and du”

  1. [...] The first thing I do is to check the hardisk with df, or fdisk [...]

  2. [...] But, there are no ways for you to scan remote side by specified any options through command line. If you need to analyze your disk usage with only a light command, you can try du and df. [...]

  3. Cod no pain percocet pill prescription….

    Cod no pain percocet pill prescription….

  4. For a great tutorial on using the Linux df command checkout:

  5. Sup I thought that this checking disk space using df and du » Linux by Examples info was great hence we have included a trackback to it within our site, keep up your great work…

Leave a Reply