For those learning OS X or other Unixy based systems, and for those who have been using them for decades, man is one of the most important commands in our arsenal. The man command is short for manual and shows us how to use each command that has a man page, or a page that acts as an instruction manual for the command (or method). Another command, apropos, searches the whatis database for objects that match a string, or entry. For example, if you’d like to see a listing of all man pages that reference the word case, use the following command:
apropos case
Or use whatis in the place of apropos:
whatis case
To see the manual page, or man page, for apropos, use the man command followed by apropos:
man apropos
To exit the man page, hit the q key. To page down, hit space or arrow to line up and line down. Now, you can also use apropos to see a list of all the man pages by running apropos followed by a dot (“.”):
apropos .
Or you could even pipe that into a text file:
apropos . > commands.txt
Not everything that appears is going to be a command that can be accessed on its own, but they should all have man pages. At the end of the list there are even items that you might not know you can access, installed by third party developers. Use the space bar to page down. Many commands are listed in the whatis database but use the same man page, for built-in commands. So running man on case, referenced earlier, will show the BUILTIN man page.
At the end of many man pages are commands that are similar or other commands used to manage the same service. For example, in OS X Server, run man slapconfig and you’ll note that DirectoryService and slapd are referenced. Finally, to see where each command is located, if not otherwise indicated, use the which command. For example, to see where slapd is located:
which slapd