2

If you start typing and pressing tab the console tries to expand and show all commands, functions and executable scripts that begin with what you have started to write.

Is there a way to see which commands the typed string anywhere in their names? Not necessarily with tab completion, but with some small function or script.

I may remember a command that has font in its name, but not in the beginning. How to make it show mkfontdir and all the others?

Or I may have a script with font somewhere in the name but not in the beginning (like my-fonts.py).

3

I normally do a find command like this

find / -executable -name '*'font 2>/dev/null

Which would result on my computer the following

/usr/bin/showconsolefont
/usr/bin/gnome-thumbnail-font
/usr/bin/splitfont
/usr/bin/showfont
/usr/bin/grub-mkfont
/usr/share/doc/ttf-freefont
/usr/share/doc/fonts-horai-umefont
/usr/share/doc/ttf-umefont
/usr/share/groff/1.21/font
/usr/share/fonts/truetype/freefont
/usr/share/fonts/truetype/horai-umefont
/bin/setfont

Although this command will be a little tighter in its results

find / -type f -perm +111 -name '*'font 2>/dev/null

Returns

/usr/bin/showconsolefont
/usr/bin/gnome-thumbnail-font
/usr/bin/splitfont
/usr/bin/showfont
/usr/bin/grub-mkfont
/bin/setfont
|improve this answer|||||
1

Since the find command Doogfar suggested takes ages to run, you can add a cronjob to run it once in a while sending it to a file:

find / -type f -perm +111 >~/.perm111 2>/dev/null &

and then a quick grep when you need it.

grep font ~/.perm111
|improve this answer|||||
0

I don't have an Ubuntu box, but this command is available on OS X and OpenSUSE:

compgen -ac | grep someStringInCommandName

Ref: https://stackoverflow.com/questions/948008/linux-command-to-list-all-available-commands-and-aliases

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.