1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-18 17:53:23 -07:00
rc/sh/dfu
2021-07-29 00:37:35 -07:00

12 lines
359 B
Bash
Executable File

#!/usr/bin/env sh
# YES_ZSH
dfu() {
[ $# -le 0 ] || { printf "%s\n" "$0: too many arguments" >&2; return 1; }
df -xtmpfs | awk '
NR==1{printf"%-20s %7s %7s %7s %7s\n","Filesystem","Used","Max","Left","Misc"}
NR>1{printf"%-20s %7.2f %7.2f %7.2f %7.2f\n",$6,$3/2^20,($3+$4)/2^20,($4)/2^20,($2-$4-$3)/2^20}'
}
[ "${SOURCING:-0}" -gt 0 ] || dfu