1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-29 21:49:26 +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 "$@"

View File

@ -0,0 +1,14 @@
#
# Reloads the Zsh configuration.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Reloads ~/.zshrc.
local zshrc="$HOME/.zshrc"
if [[ -n "$1" ]]; then
zshrc="$1"
fi
source "$zshrc"