quick disk usage check

Here’s a quick one liner for checking your disk usage your current working directory (cwd):

nice -n 19 du -ks * | sort -rn | awk '{print $1 "KB\t", $1 / 1024 "MB\t", $2 }'

Some sample output looks like:

5459316KB 5331.36MB 2008.11
4960112KB 4843.86MB 2009.06

Some notes:

  • Doesn’t check for hidden files/folders.
  • The $2 argument prints out the name of the file or folder, but if there’s a space in the name, it’ll only print whatever is before the space in the file.
This entry was posted in software and tagged , , . Bookmark the permalink.

Leave a Reply

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