9

Tip #204   Find matching programs

Sometimes you want to find a program without knowing the full name. This can be done with the following one liner:

IFS=: ; for D in $PATH; do for F in $D/*PATTERN*; do [ -x $F ] && echo $F; done; done

For example:
$ IFS=: ; for D in $PATH; do for F in $D/*text*; do [ -x $F ] && echo $F; done; done
/usr/bin/gettext
/usr/bin/glib-gettextize
/usr/bin/gnome-text-editor
/usr/bin/xgettext