Untitled Document
du Command

du command stands for disk usage which reports the consumption of a specific directory tree rather than an entire file system . du command reports usage by a recursive examination of the directory tree .

1. Basic example -

Run the du command on  /I/mangu.the.geek/13.9.14/logs.

   du /I/mangu.the.geek/13.9.14/logs

At the last of output it produces summary of files .

2. du with -s option

The -s option displays the details the summary of du command output . Sometimes the directory tree might be large and if we are intrested to see only summary of disk usage the -s option supress this list and prints only summary .

   df -s  /I/mangu.the.geek/13.9.14/logs

3.Assessing the space consumed by Users -

The following command prints the list of all users along with it disk consumption .

du -s /home/*

4.Print total disk usage of .txt files in directory -

du -shc *.txt
Untitled Document