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:
20
modules/utility/functions/duh
Normal file
20
modules/utility/functions/duh
Normal 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 "$@"
|
||||
|
Reference in New Issue
Block a user