1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 10:51:41 +00:00

[#23] Convert utility into a module

This commit is contained in:
Sorin Ionescu
2012-03-28 13:02:29 -04:00
parent a7340886b3
commit 73478bd190
4 changed files with 0 additions and 1 deletions

View File

@ -0,0 +1,20 @@
#
# Displays human readable disk usage.
#
# Authors:
# Suraj N. Kurapati <sunaku@gmail.com>
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
function duh {
(( $# == 0 )) && set -- *
if [[ "$OSTYPE" == linux* ]]; then
du -khsc "$@" | sort -h -r
else
du -kcs "$@" | awk '{ printf "%9.1fM %s\n", $1 / 1024, $2 } ' | sort -n -r
fi
}
compdef _du duh
duh "$@"