From d158a0a373925e90394f7db064b4e8fac8a17fdc Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sun, 23 Aug 2020 19:46:13 -0700 Subject: [PATCH] Usage util duf. --- dotfiles/zshrc.d/usage.zsh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 dotfiles/zshrc.d/usage.zsh diff --git a/dotfiles/zshrc.d/usage.zsh b/dotfiles/zshrc.d/usage.zsh new file mode 100644 index 0000000..cb6804b --- /dev/null +++ b/dotfiles/zshrc.d/usage.zsh @@ -0,0 +1,3 @@ +function duf { + 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 +}