CLI magic: whatis apropos?

77

Author: Joe Barr

I hate to admit it, but my memory is not as good as it once was. When I can’t remember something on my Linux box, I often open a console window to get to the CLI for assistance. Once at the command line, I take advantage of these two handy little CLI tools: whatis and apropos. Maybe you’ll find them useful too.

What is apropos?

In those moments when my memory she is not all that she should be, it’s good to know whatis apropos. That’s not a typo in a phrase: whatis and apropos are two separate but related programs.

Here’s how they are related. Both whatis and apropos use the whatis database to help remember things like program names, functionality, and keywords. Typically, Linux distributions schedule a program called makewhatis to maintain the whatis database. It does this by reading all the man pages on your system and making sure all the programs and keywords found there are present in the database.

Recently, I needed to find a program to manipulate sound files. I knew it existed because I had used it in the past, but I couldn’t remember its name. Here’s how apropos helped me remember.

The basic format for apropos is:

apropos search-term

In my case, I was looking for a tool to use with sound files, so I decided to search for sound. Here’s what apropos had to say:


SDL::Sound (3pm) - a perl extension
Sweep [sweep] (1) - a sound wave editor
Text::Soundex (3pm) - Implementation of the Soundex Algorithm as Describ ed by Knuth
alsaconf (8) - configuration tool for the Advanced Linux Sound Arch itecture
alsactl (1) - advanced controls for ALSA soundcard driver
alsamixer (1) - soundcard mixer for ALSA soundcard driver, with ncur ses interface
amixer (1) - command-line mixer for ALSA soundcard driver
aplay (1) - command-line sound recorder and player for ALSA soun dcard driver
aplay [arecord] (1) - command-line sound recorder and player for ALSA soun dcard driver
arecord (1) - command-line sound recorder and player for ALSA soun dcard driver
arecord [aplay] (1) - command-line sound recorder and player for ALSA soun dcard driver
esd (1) - The Enlightened Sound Daemon
esdcat (1) - The Enlightened Sound Daemon
esdctl (1) - The Enlightened Sound Daemon
esdfilt (1) - The Enlightened Sound Daemon
esdloop (1) - The Enlightened Sound Daemon
esdmon (1) - The Enlightened Sound Daemon
esdrec (1) - The Enlightened Sound Daemon
esdsample (1) - The Enlightened Sound Daemon
libst (3) - Sound Tools : sound sample file and effects librarie s
play (1) - play any sound file to audio device .P rec - record audio to any sound file format
play [rec] (1) - play any sound file to audio device .P rec - record audio to any sound file format
sox (1) - Sound eXchange : universal sound sample translator


Anytime apropos saw “sound” in its database, it told me the name of the program and gave brief description of it. At the bottom of that list I found sox, which allows you to translate sound files from one audio format to another, as well as add reverb or echo or other sound effects. It’s a handy little program, for sure.

If you think you know the name of the program you need, you can try the whatis utility instead of apropos. The format is the same as for apropos, except in this case, the search term is the name of a program.

whatis program_name

The whatis program told me the same thing about sox as apropos did:

sox (1) – Sound eXchange : universal sound sample translator

Naturally, if you’re still not sure if that’s the right tool, use man to learn more.