Sort Directories by Size


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # Display the size of all directories and sort them from largest to smallest.
  2. du -sk * | sort +0nr
  3.  
  4. # Sort them from smallest to largest.
  5. du -sk * | sort +0n
  6.  
  7. # Sort and show the size of hidden directories.
  8. du -sk .[a-z]* | sort +0nr

URL: http://spiralbound.net/2006/11/27/using-sort-to-list-directories-by-size

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.