From 336ff9292ae5a6bcf41eacbb5a892c138644d50c Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 28 Jul 2021 14:35:17 -0400 Subject: [PATCH] shows disk usage summaries if GB or above in size --- scripts/files/show_just_biggies.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/files/show_just_biggies.sh diff --git a/scripts/files/show_just_biggies.sh b/scripts/files/show_just_biggies.sh new file mode 100644 index 00000000..782ab15e --- /dev/null +++ b/scripts/files/show_just_biggies.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# iterates through the directories or files passed on the command line and does a summary disk usage, but only the +# things measurable in gigabytes, terabytes, or larger are shown. the smaller items are just omitted (so anything +# measurable within megabytes, kilobytes, and bytes, as decided by the human-readable du command. + +for dir in "${@}"; do + du -sh "$dir" 2>/dev/null | grep -v "^[ 0-9.]*K\|^[ 0-9.]*M\|^[ 0-9.]*B" +done -- 2.34.1