Posted By

mprabhuram on 10/28/10


Tagged

shellscript UnixScripts


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

mauguar


List directories by size in Linux / AIX


 / Published in: Bash
 

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

  1. To list the directory sizes in kilo bytes and largest at the top
  2. du -sk * | sort +0nr
  3. du -sk * | sort -nr
  4.  
  5. To list the directory sizes in Mega bytes and largest at the top
  6. du -sm * | sort +0nr
  7. du -sm * | sort -nr
  8.  
  9. To list the directory sizes in kilo bytes and largest at the bottom.
  10. du -sk * | sort +0n
  11. du -sk * | sort -n
  12.  
  13. To list the directory sizes in Mega bytes and largest at the bottom.
  14. du -sm * | sort +0n
  15. du -sm * | sort -n
  16.  
  17. To list the directory sizes in human readable format (Mix of kilo, Mega and Giga bytes) and largest at the bottom
  18. du -s *|sort -n|cut -f 2-|while read a;do du -hs $a;done
  19.  
  20.  
  21. To list the size of hidden directories
  22.  
  23. du -sk .[a-z]* | sort +0nr
  24.  
  25. To list the size of all the files and directorires including hidden files and directories
  26. du -sk .[a-z]* * | sort +0n

Report this snippet  

You need to login to post a comment.