2020-11-23 23:20:02 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# shows size statistics for subfolders
|
|
|
|
# max depth is equal to the first argument if it is a number or 1
|
2022-03-15 15:56:22 +00:00
|
|
|
case "$1" in (+*) size=${1#+}; depth=2; shift;; esac
|
|
|
|
case "$1" in ([0-9]) depth=$1; shift;; esac
|
|
|
|
(du --max-depth "${depth:-1}" -xhat ${size:-50}M "$@" | sort -h | grep -v "^0") ||
|
2021-09-16 12:18:26 +00:00
|
|
|
(du --max-depth "${depth:-1}" -xha "$@" | sort -h | tail)
|