Now that you are familiar with the built-in help in Unix and how to use the man pages and the man command, we will look at some other ways to use man. We'll also explore the use of apropos and whatis, two programs that can help you find additional assistance. As mentioned earlier, the man command can often generate unwieldy results. This can be especially problematic if you just want to see a subset of the information on a man page. If this subset is all you need (for example, if you only want to view a summary description of a command), then you can use the following commands: whatis man f apropos man k Using any of these followed by the command you are interested in (just like the man ls example) will result in a shorter set of information being supplied back to you. Let's look at each of these commands in detail. whatis and man fThe man command used with the f switch is similar to the whatis command, just as apropos is similar to the man command with the k switch. The full power of most Unix commands can only be unleashed with the use of switches, so make sure you pay close attention to how they are used in this lesson and in the rest of the book.
By using man -f or whatis followed by a command name, you will get a description summary of that command. For example, to print a description summary for the date command, type the following, and a short description of what date does will be returned. Press q to return to the command line. >man -f date date (1) - print or set the system date and time END There should be a whatis database on your system. If it has been removed from your system or never created, you may get an error reported back to you. Ask your Unix system administrator for help, because privileged access to the Unix system is needed to create a database if one does not already exist. apropos and man -kWhen using the apropos or man -k commands, you will see similar functionality to the whatis and man f and man f commands, but what makes these commands different is that they can help you find a result based on a possible match. In other words, if you are clueless about what command you want help on but have some idea about it, entering that idea with apropos or man k will return a result if any partial matches can be made. Try running apropos on time and compare your results with the results from the similar whatis time command: >apropos time clock (3) - Determine processor time clock (n) - Obtain and manipulate time convdate (1) - convert time/date strings and numbers date (1) - print or set the system date and time difftime (3) - calculate time difference ftime (3) - return date and time ftpshut (8) - close down the ftp servers at a given time kbdrate (8) - reset the keyboard repeat rate and delay time ldconfig (8) - determine run-time link bindings metamail (1) - infrastructure for mailcap-based multimedia mail handling nanosleep (2) - pause execution for a specified time nwfstime (1) - Display / Set a NetWare server's date and time parsedate (3) - convert time and date string to number ... In this example, we see quite a few results displayed, but we also see the ..., which means that there are even more results that are not shown onscreen. Sometimes, if you are not sure what you are looking for and are too vague in your request, you can get hundreds of responses. Searching through these results is time consuming, so use apropos and man k as a last resort for finding help if needed. |