man
From NetBSD Wiki
The man(1) utility displays manual pages (or "manpages") from the on-line manual. The on-line manual is the primary place to get information about Unix commands, library calls and device drivers on your system.
Contents |
Sections
Sometimes there are several manpages with the same name, about different aspects or different implementations of a concept. For example, there is a printf(3) C library call, but there is also a shell command called printf(1). This is possible because the manual is divided up in sections, indicated by a section number (on other Unix systems these sometimes also include section letters). You can find the meaning of the section numbers in the mdoc(7) manpage (search for 'title macros').
When people refer to a concept, they put the section between parentheses behind the command name. They will ask you, for example, "how does printf(1) work?". This means they're referring to the printf shell command (from section 1), not the C library function (from section 3). If you just type in 'man printf' at the commandline, you generally get the first found manpage. You can use the -s switch to specify a particular section.
Searching
One disadvantage about man(1) is that it requires you to already know the name of a command you're requesting information about. The assumption is that you already know enough and just need to look up specifics you can't remember. However, there is a way to search through the title of all manual pages on your system: apropos (also available through man -k).
Examples
% man printf
Shows the manual page for the printf(1) shell command
% man 3 printf
Shows the manual page for the printf(3) library call
% man -s 3 print
Same as the above
% man rtk
Shows the manual page for the driver for realtek network cards
% man -k game
Shows a list of all manual pages that have 'game' in their title
