Getting Help
Linux offers many ways to get help, I will discuss 2 of them used by most Linux Administrators
· man & help commands
· Man: man is the interface used to view the system's reference manuals.
à man is the system's manual viewer; it can be used to display manual pages, scroll up and down, search for
occurrences of specific text, and other useful functions.
à Man pages are organized in a very structured way that helps you find the information you need as quickly as possible
à Type “man” followed by a command . . . Press “q” to quit the manpage
à Very useful way to get more info on how to use a given command. . .the Problem: it works only if you know the exact name of the command you want to know more about
Searching by Keyword:
n There’s a small solution to “the Problem”. . .use “man –k” option, which allows you to locate the command you need by looking at keywords…
Example:
man –k time | grep 1 (show only lines from man section 1 that have the word time in the description)
n Side Note: grep prints lines of input matching a specified pattern
à Each argument given to man is normally the name of a program, utility or function.
à The manual page associated with each of these arguments is then found and displayed; A section number, if
provided, will direct man to look only in that section of the manual.
è Example: man passwd OR man man
--- View the manual page for the passwd command // View the manual page for the man command.
à To use “man”, you rely on the “whatis” database that exists on your system
n If it doesn’t exists, you’ll see a “nothing appropriate” message on everything you try to do:: Fix: use “makewhatis” command
--- it creates your database. . .can take a few minutes to complete, but once it does, you have a “whatis” database and now “man” can
be used.
n Overview of “man” sections:
"man" sections:
- There are several sections within "man" pages.
§ Section 1: refers to user commands
§ Section 4: contains special files
§ Section 5: describes system configuration files
§ Section 8: includes system administration commands
Section Numbers
The section numbers of the manual are listed below. While reading documentation, if you see a command name followed by a number in parentheses, the number refers to one of these sections. For example, man is the documentation of man found in section number 1. Some commands may have documentation in more than one section, so the numbers after the command name may direct you to the correct section to find a specific type of information.
The section numbers, and the topics they cover, are as follows:
1 / Executable programs or shell commands
2 / System calls (functions provided by the kernel)
3 / Library calls (functions within program libraries)
4 / Special files (usually found in /dev)
5 / File formats and conventions eg /etc/passwd
6 / Games
7 / Miscellaneous (including macro packages and conventions), e.g. man, groff
8 / System administration commands (usually only for root)
9 / Kernel routines [Non standard]
à The most important information that you will use as a system admin is in sections 1, 5, and 8
à entries can exist in more than 1 section:
Example: there is info on “passwd” in section 1 & 5 . . . man will show the content of the 1st entry it finds
n To make sure all info you need is displayed, use “man –a passwd” . . . man browses all sections for info on your command
à If you know beforehand the specific section to search, specify the section number: Example: man 5 passwd
Name This is the name of the command. It describes in one or two lines what the command is used for.
Synopsis H ere you can find short usage information about the command. It will show all available options and indicate whether it is optional (it will be between square brackets) or mandatory (it will not be between brackets).
Description The description gives a long explanation of what the command is doing. Read it to get a clear and complete picture of the purpose of the command.
0ptions This is a complete list of all options that are available. It documents the use of all of them.
Files This sec tion provides a brief list of files, if any, that are related t o the command about which you want more information.
See Also A list of related comma nds.
Author The author and a lso the email address of the person who wrote the man page.
§ help option:
à Display information about builtin commands
--> Options:
--- -d : output short description for each topic
--- -m : display usage in psuedo-manpage format
--- -s : output only a short usage synopsis for each topic matching
à Example: help echo / help -d echo (using option)
Display a brief description of the builtin shell command "echo"
Find out if a command is built-in or external:
Ex: type -a cd uname [type -a command-name-here]
List of built-in commands:
-- SEE LABS Website -- Under: Additional Resources