Return to Snippet

Revision: 34796
at October 28, 2010 07:20 by mprabhuram


Initial Code
To list the directory sizes in kilo bytes and largest at the top
du -sk * | sort +0nr
du -sk * | sort -nr

To list the directory sizes in Mega bytes and largest at the top
du -sm * | sort +0nr
du -sm * | sort -nr

To list the directory sizes in kilo bytes and largest at the bottom.
du -sk * | sort +0n
du -sk * | sort -n

To list the directory sizes in Mega bytes and largest at the bottom.
du -sm * | sort +0n
du -sm * | sort -n

To list the directory sizes in human readable format (Mix of kilo, Mega and Giga bytes) and largest at the bottom
du -s *|sort -n|cut -f 2-|while read a;do du -hs $a;done


To list the size of hidden directories

du -sk .[a-z]* | sort +0nr

To list the size of all the files and directorires including hidden files and directories
du -sk .[a-z]* * | sort +0n

Initial URL
http://lokams.blogspot.com/2008/03/list-folders-directories-by-size-in.html

Initial Description


Initial Title
List directories by size in Linux / AIX

Initial Tags


Initial Language
Bash