Thursday, July 24, 2014

Customizing the UNIX User Environment - Part 4 - UNIX documentation - Part 3

Customizing the UNIX User Environment

**********************************************************************************

UNIX documentation

**********************************************************************************

Apropos and man -k

------------------------------

You dont have to know the name of a particular command to use its man pages.

You can also search by using keywords. This search, which you incoke using the apropos keyword, returns a set of commands containing the keyword in their hearder lines.

You can then use this list to select the correct command for your task.

 

Lets say that you want to perform a task that involves copying data, but you dont know the best command to use.

In this case, you use the keyword "copy", and you type the following at the shell prompt:

apropos copy

 

Apropos searches header lines and return a list of all the man pages containing the word "copy" in their headers.

 

The list that apropos returns contains relecant commands with a number in parentheses - for example, cpio(1).

The number in parantheses represents the section number of the main page, in which you can find each returned command.

 

Apropos may not work on some computers. In this case, you can use the

man-k

command as an alternative.

Tor example, to access help information on how to copy data, you type the following at the shell prompt:

man -k copy

 

The out put is similar to that of apropos

 

The whatis command provides more restricted searches than man -k and apropos commands.

The man -k and apropos commands search for short descriptions and manual page names, whereas the whatis command searches for exact matches only.

For example, typing whatis copy returns the exact matches for copy as shown here.

 

You can send a man page, for example the copy man page, to a local printer using the lpr command.

However, you may need to format a man page, for example add a header containing the filename and page number, before sending it to the printer.

You may also need to convert it to an appropriate outpit format for a specified printer.

 

To print a man page for copy to a PostScript printer, for example, you use the -toption.

You can then pipe the output to lpr or save it to a file, which you convert for a specific printer.

 

man -t copy | lpr

 

You can save a man page to a file and print it when ever you need to. eg

man -t copy > copy.ps

will copu the man page to the file copy.ps

 

Summary

****************************

The UNIX online manual - also called the man pages - is an electronic collection of information about UNIX commands. Man pages are digital versions of the UNIX programmer's manual and are used to provide a quick reference to users on how to find help with UNIX commands.

Inless otherwise specified, you  navigate man pages using the default pager specified in the user's environment.

The apropos program enables users who don't know the name of the command they want to access to obtain help information on that command.The command searches for information by keywords and returns a list of relevant matches. In the absence of an apropos program, the man -k command performs a similar function. If you want to check whether a man page for a particular command is on the system, you can use the whatis command, which provides a narrower search.

No comments:

Post a Comment