mirror of
https://github.com/notwa/rc
synced 2024-11-05 03:39:02 -08:00
20 lines
381 B
Bash
Executable file
20 lines
381 B
Bash
Executable file
#!/usr/bin/env zsh
|
|
# YES_ZSH
|
|
|
|
cdbusiest() { ### @-
|
|
### cd to the directory with the most files in it, counted recursively.
|
|
###
|
|
### ```
|
|
### $ cd
|
|
### $ cdbusiest
|
|
### 152364 src
|
|
### $ pwd
|
|
### /home/notwa/src
|
|
### ```
|
|
dbusiest | read -r c d
|
|
[ -z $c ] && return 1
|
|
printf "%s\n" "$c $d"
|
|
cd $d
|
|
}
|
|
|
|
[ -n "${preload+-}" ] || cdbusiest "$@"
|