Skip to content

Instantly share code, notes, and snippets.

@pce
Created May 30, 2012 23:44
Show Gist options
  • Save pce/2839597 to your computer and use it in GitHub Desktop.
Save pce/2839597 to your computer and use it in GitHub Desktop.
cat ~/.bash_alias >> ~/.bashrc && source ~/.bashrc
# duh - disk usage humanreadable, source 'inataysia' reddit
alias duh='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