From 54d88962c0f4464197dadf5b9684b53f09f0212e Mon Sep 17 00:00:00 2001 From: gabriel becker Date: Thu, 10 Aug 2023 21:24:02 +1000 Subject: [PATCH] Create bash utils aliases. Include dus to show sorted dize of files/paths --- bash_utils | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 bash_utils diff --git a/bash_utils b/bash_utils new file mode 100644 index 0000000..75e5287 --- /dev/null +++ b/bash_utils @@ -0,0 +1,3 @@ +dus () { + du -h ${1} -d ${2:=1} | sed 's/\([[:digit:]]\)\t/\1B\t/' | sed 's/\(.\t\)/\t\1/' | sed 's/G\t/Z\t/' | sort -n -k 2d,2 -k 1n,1 | sed 's/Z\t/G\t/' +}