Getting Help In Unix

Contents
1 man 
2 info 
3 apropos 
4 whatis 
5 makewhatis 

[edit] man
man displays the manual page for the specified command

A useful option is:

-k TEXT  search manual page titles and synopsis lines for TEXT

Examples:

To display the manual page for the chown command:

$ man chown
man has different sections.

section 1 is user commands 
section 2 is system calls (used by programs to communicate with the kernel) 
section 3 is library reference (for programming in C) 
section 4 is device drivers 
section 5 is configuration files and other file formats 
section 6 is games 
section 7 is miscellaneous (for example, "ascii" map and C "operator" precedence) 
section 8 is system commands (like user commands, but mostly for root) 

A section number can be specified before the page name. For example, man chmod normally shows the user command "chmod". To see the system call "chmod":

$ man 2 chmod
To search the man pages for "newsgroups",

$ man -k newsgroups
actsync              (8)  - synchronize newsgroupsoups
newsgroups           (1)  - a program to list unsubscribed newsgroups

If this does not work you may have to run the makewhatis command. 

[edit] info
info is an advanced man command that is sometimes available. It displays the improved manual pages in Info format for specified command.

Examples:

To display the manual page for the grep command:

$ info grep

To find occurrence of 'grep' in all info manual pages:

$ info --apropos grep
"(autoconf-2.13)Examining Declarations" -- EGREP_CPP
"(autoconf-2.13)Examining Declarations" -- EGREP_HEADER
"(autoconf-2.13)Old Macro Names" -- HEADER_EGREP
...

Some copies of info lack the "-w" option. 

To see the physical location of 'grep' info manual page:

$ info -w grep

/usr/share/info/grep.info.gz

To view a file a info page:

$ info -f ./some_cmd.info.gz

[edit] apropos

apropos searches the manual page short descriptions for a specified keyword

On many systems this is exactly the same as the -k option of the man command.

Examples:

$ apropos newsgroups
active               (5)  - list of active Usenet newsgroups
newsgroups           (1)  - a program to list unsubscribed newsgroups

[edit] whatis
whatis displays short man page descriptions. Unlike

Examples:

$ whatis info
info (1)             - read Info documents
info (5)             - readable online documentation
$ whatis chmod
chmod (1) - change file modes
chmod, fchmod (2) - change mode of file

[edit] makewhatis

makewhatis creates the database for the whatis, appropos, and man -k commands. This is commonly run automatically by your system however sometimes you need to run this manually.

Examples:

# makewhatis
$ sudo makewhatis

Unix Tips

See Also
Using The Tail Command

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.