Skip to content

Instantly share code, notes, and snippets.

@jhasse
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhasse/eb57f5563719dce930d6 to your computer and use it in GitHub Desktop.
Save jhasse/eb57f5563719dce930d6 to your computer and use it in GitHub Desktop.
shopt -s dotglob
du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment