diff --git a/sh/dbusiest b/sh/busiest similarity index 54% rename from sh/dbusiest rename to sh/busiest index 0fddc02..1e2ee66 100755 --- a/sh/dbusiest +++ b/sh/busiest @@ -4,16 +4,15 @@ # NO_DASH # NO_ASH -dbusiest() { ### @- - ### list directories ordered descending by the number of files in them, - ### counted recursively. see also [`cdbusiest`.](#cdbusiest) +busiest() { ### @- + ### list directories in descending order by the number of files in them, + ### counted recursively. ### ### ``` - ### $ cd - ### $ dbusiest | head -n3 - ### 152364 src - ### 46518 work - ### 20903 play + ### $ cd && busiest | head -n3 + ### 144181 src + ### 48840 work + ### 21042 play ### ``` [ $# -le 0 ] || { printf "%s\n" "$0: too many arguments" >&2; return 1; } local c d @@ -25,4 +24,4 @@ dbusiest() { ### @- [ -z $d ] && return 1 } -[ -n "${preload+-}" ] || dbusiest "$@" +[ -n "${preload+-}" ] || busiest "$@" diff --git a/sh/cdbusiest b/sh/cdbusiest deleted file mode 100755 index 71fe7e0..0000000 --- a/sh/cdbusiest +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env zsh -# YES_ZSH -# NO_BASH -# NO_DASH -# NO_ASH - -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+-}" ] || . ~/sh/preload || exit 2 -eval ${preload:-preload} dbusiest -[ -n "${preload+-}" ] || cdbusiest "$@"