2021-01-23 19:51:23 +01:00
|
|
|
#!/bin/sh
|
2021-11-07 06:00:29 +01:00
|
|
|
# List files recursively with [dirsfirst] including hidden files (-a)
|
|
|
|
# showing sizes of directories (--du) and files in [h]uman readable form
|
|
|
|
# with forced [C]olorization and pipe into less
|
|
|
|
# If first arg is a digit, it displaces the default depth of 3
|
|
|
|
# Any other arguments (usually pathnames) are passed on to the tree command
|
2021-01-23 19:51:23 +01:00
|
|
|
case "$1" in [0-9]) depth=$1; shift;; esac
|
2021-06-18 17:54:39 +02:00
|
|
|
tree -a --dirsfirst -L ${depth:-3} --du -h -C "$@" | ${PAGER:-less}
|