7.2.2. The du command

Now that you know how much space has been used on a filesystem how can you find out where that data is? To view usage by a directory or file you can use du. Unless you specify a filename du will act recursively. For example:

|

user@server:~> **du file.txt**
1300    file.txt

</font> | | --- |

Or like the df I can use the -h and get the same output in "human-readable" form.

|

user@server:~> **du -h file.txt**
1.3M     file.txt

</font> | | --- |

Unless you specify a filename du will act recursively.

|

user@server:~> **du -h /usr/local**
4.0K    /usr/local/games
16K     /usr/local/include/nessus/net
180K    /usr/local/include/nessus
208K    /usr/local/include
62M     /usr/local/lib/nessus/plugins/.desc
97M     /usr/local/lib/nessus/plugins
164K    /usr/local/lib/nessus/plugins_factory
97M     /usr/local/lib/nessus
12K     /usr/local/lib/pkgconfig
2.7M    /usr/local/lib/ladspa
104M    /usr/local/lib
112K    /usr/local/man/man1
4.0K    /usr/local/man/man2
4.0K    /usr/local/man/man3
4.0K    /usr/local/man/man4
16K     /usr/local/man/man5
4.0K    /usr/local/man/man

</font> | | --- |

If you just want a summary of that directory you can use the -s option.

|

user@server:~> **du -hs /usr/local**
210M    /usr/local

</font> | | --- |

results matching ""

    No results matching ""