DEV Community

Bash Command Completion - Finding all the cats in your $PATH!

Raunak Ramakrishnan on November 15, 2018

Today, I was curious to find out how many programs ending with cat I had on my system. I remember using cat, zcat and wanted to know if there are s...
Collapse
 
jrbrtsn profile image
John Robertson

Find all executable files in your path ending with 'cat':

find ${PATH//:/ } -type f  -executable -name '*cat'
/usr/sbin/tarcat
/usr/sbin/postcat
/usr/bin/msgcat
/usr/bin/systemd-cat
/usr/bin/pacat
/usr/bin/gencat
/usr/bin/fc-cat
/usr/bin/precat
/usr/bin/pnmcat
/usr/bin/socat
/bin/zcat
/bin/bzcat
/bin/ntfscat
/bin/cat

Collapse
 
gypsydave5 profile image
David Wickes

apropos -s 1 'cat$'

Great use of man there.

Collapse
 
rrampage profile image
Raunak Ramakrishnan

I also learned today that man -k is equivalent to apropos