When a command is installed, an entry should have been placed in the
whatis database. However, there is no requirement to do so. To get a one line description of a command in the database, enter
whatis followed by the command. For example, the output from entering
whatis "ruby" is shown below.
erb(1) - Ruby Templating
irb(1) - Interactive Ruby Shell
ri(1) - Ruby API reference front end
ruby(1) - Interpreted object-oriented scripting language
whatis command will accept regular expressions. Therefore, to get a list of all commands in the database, enter the command given below.
The man page for
whatis states the following:
whatis searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. Only complete word matches are displayed.
There also exists a similar command called
apropos. The man page for
apropos states the following:
apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output.
Basically, the difference is
apropos does not require complete word matches. For example,
whatis "string" would not find a match when encountering
apropos "string" would.