2021-01-23 18:51:23 +00:00
|
|
|
#!/bin/sh
|
2022-01-10 10:52:17 +00:00
|
|
|
# [t]ree [l]ist
|
2021-11-07 05:00:29 +00: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-11-09 04:37:07 +00:00
|
|
|
case "$1" in ([0-9]) depth=$1; shift;; esac
|
2023-07-27 15:16:41 +00:00
|
|
|
tree --dirsfirst --du -h -C -L ${depth:-3} -I node_modules "$@" | ${PAGER:-less} -rF
|