Learning about Commands, Part III
- 0
- Add a Comment
Learning about Commands, Part III
man, or “Manual” pages in Linux (and Unix) are
organized in a series of groups according to topics, called
“sections.” The man sections
are:
- User commands.
- System commands offered by the
kernel. - Library functions (like C programming libraries)
- Device commands (try typing
man)
hd - File formats, typically for configuration files
- Game-related commands
- Miscellaneous
- Root only system
administration tools - Linux-specific system commands (as
opposed to other forms of Unix)
Why did we take a side step into this topic? You need to
understand this information to fully take advantage of the apropos command. When you type:
apropos file | more
you get a ton of responses. My list starts with:
.ldaprc [ldap] (5) - ldap configuration file /etc/anacrontab [anacrontab] (5) - configuration file for anacron /etc/isdn/callerid.conf [callerid] (5) - config file for isdnlog numbers and scripts /etc/isdn/isdn.conf [isdn] (5) - config file for isdnlog /etc/isdn/isdnlog.users [isdnlog] (5) - user base isdnlog config file /etc/nscd.conf [nscd] (5) - name service cache daemon configuration file /etc/yp.conf [yp] (5) - NIS binding configuration file
In each case, these items are configuration files, as we can see
from the section number in parentheses. The names in square
brackets are what you use to actually call the man page, since you don’t use something like
man /etc/anacrontab. Instead
you use man anacrontab. A bit
later in the list I have:
AnyDBM_File (3pm) - provide framework for multiple DBMs B::Showlex (3pm) - Show lexical variables used in functions or files BIO_append_filename (3ssl) - FILE bio BIO_append_filename [BIO_get_fp] (3ssl) - FILE bio BIO_append_filename [BIO_new_file] (3ssl) - FILE bio BIO_append_filename [BIO_new_fp] (3ssl) - FILE bio BIO_append_filename [BIO_read_filename] (3ssl) - FILE bio
These items are all from section 3, and so are library functions.
To view the B::Showlex perl module’s (pm’s) man page, we would type man B::Showlex. However, for the SSL function
BIO_append_filename “get fp” variant, we would type man BIO_get_fp.
If you know that what you’re looking for is not a programming
library, then the last thing you want is screens and screens of
section 3 items in your apropos output. We’ll take a look at how
to deal with this problem next week.
Next week: A trick for filtering out everything from
section 3.
