Jump to Navigation

245 - du command

The du command is used to summarize disk usage of each file in a file system, recursively for directories.

# du -s /var/log/* | sort -nr | head -5

# du -s ./* | sort -nr | head -5

sort

The sort command is used to sort lines of text.
* The -r option sorts in reverse order, so what would normally be at the bottom of the output is now at the top. For a numeric sort, the largest numbers are at the top.
* The -n option sorts in numeric mode, as opposed to the default lexicographic sort.

 

Linux:


Main menu 2

Story | by Dr. Radut