summaryrefslogtreecommitdiff
path: root/.local/bin/space
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/space')
-rwxr-xr-x.local/bin/space12
1 files changed, 12 insertions, 0 deletions
diff --git a/.local/bin/space b/.local/bin/space
new file mode 100755
index 0000000..a8eaa31
--- /dev/null
+++ b/.local/bin/space
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Check if at least one argument is passed
+if [ "$#" -eq 0 ]; then
+ echo "Usage: $0 <file_or_directory> [<file_or_directory> ...]"
+ exit 1
+fi
+
+# Loop through all the arguments and perform 'du -sh' on each
+for item in "$@"; do
+ du -sh "$item"
+done | sort -h