$ perl -MPath::Tiny -E 'for my $dir ( split(/:/,$ENV{PATH}) ){say for grep {-f -x $_} path($dir)->children }' #### $ print -l "${(@k)commands}" | sort | tail zipinfo zipnote zipsplit zless zmore zmqshell.py znew zprint zsh zsh-5.8 $ print $commands[zsh] /usr/local/bin/zsh