Command Line | du Disk Usage Commands | Tips

Share it!!Share on Facebook4Share on Google+2Tweet about this on Twitter10Share on Reddit0Share on StumbleUpon0

du is a disk usage command allows you to easily know file and directory sizes, also you can view file and directory sizes decreasing starting by biggest file, otherwise increasing by smallest file.

Here’re a few basic du commands frequently used.

du -a

du –all shows all files and directories included in currently opening directory.

du -h

du –human-readable views file and directory sizes with readable by human in KB, MB, and GB.

du -s

du –summarize display only a total for each argument.

du -S

du -separate-dirs command don’t include sub-directories sizes.

du --time

Shows the last time modifications for each file, directory and sub-directories as well.

Check more du commands by typing

du --help

Few du advanced commands

Search current directory and sub-directories for biggest files

find -type f -exec du -sh {} +  | sort -rh | head

Shows file, directory and sub-directory sizes including hidden files with increase sorting.

du -sk .[!.]* *| sort -n

Shows file, directory and sub-directory sizes including hidden files with decrease sorting.

du -sk .[!.]* *| sort -nr

Replace [!.] with [!] to stop viewing hidden files

include -h for viewing files with human readable file and directory sizes.

du command more resources

linfo

GNU coreutils

Share it!!Share on Facebook4Share on Google+2Tweet about this on Twitter10Share on Reddit0Share on StumbleUpon0
4 Comments

Add a Comment

Your email address will not be published. Required fields are marked *