1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-07-01 11:17:12 -07:00
rc/sh/cdbusiest

21 lines
386 B
Plaintext
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-08-01 08:07:55 -07:00
###
### ```
### $ cd
### $ cdbusiest
### 152364 src
### $ pwd
### /home/notwa/src
### ```
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 "$@"