2020-12-29 08:38:07 -08:00
|
|
|
#!/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
|
2021-07-29 05:44:12 -07:00
|
|
|
printf "%s\n" "$c $d"
|
2021-07-29 00:37:35 -07:00
|
|
|
cd $d
|
|
|
|
}
|
|
|
|
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || cdbusiest "$@"
|