mirror of
https://github.com/mr0xb/scripts.git
synced 2026-08-27 19:34:57 -04:00
add old scripts
This commit is contained in:
parent
1c58245cc5
commit
9c1772908b
18 changed files with 338 additions and 0 deletions
18
util/bigdirs
Executable file
18
util/bigdirs
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Show the largest directories within a target path (default: $HOME)
|
||||
TARGET="${1:-$HOME}"
|
||||
|
||||
if [[ ! -d "$TARGET" ]]; then
|
||||
echo "❌ '$TARGET' is not a directory."
|
||||
echo "Usage: $0 [path]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔎 Scanning: $TARGET"
|
||||
echo "📁 Top 10 largest directories:"
|
||||
echo
|
||||
|
||||
du -h --max-depth=1 "$TARGET" 2>/dev/null \
|
||||
| sort -hr \
|
||||
| head -n 10
|
||||
Loading…
Reference in a new issue