1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 13:09:03 -08:00
rc/sh/cdbusiest

13 lines
264 B
Text
Raw Normal View History

#!/usr/bin/env zsh
2021-07-29 00:37:35 -07:00
# YES_ZSH
2021-07-30 17:57:08 -07:00
cdbusiest() { ### @-
### cd to the directory with the most files in it, counted recursively.
2021-07-29 00:37:35 -07:00
dbusiest | read -r c d
[ -z $c ] && return 1
printf "%s\n" "$c $d"
2021-07-29 00:37:35 -07:00
cd $d
}
[ "${SOURCING:-0}" -gt 0 ] || cdbusiest "$@"