Linux-getting Help

Source: Internet
Author: User

Part 1:man Pages

As previously mentioned, UNIX is the operating system from which the Linux Foundation is built. The developers of UNIX created help documents called man pages (Mans stands for manual).

Man pages is used to describe the features of commands. They'll provide you with a basic description of the purpose of the command, as well as provide details regarding the OPT Ions of the command.

1. Viewing man pages

To view a mans page for a command, execute in man command a terminal window. For example, the command would display the man page for the man cal cal command:

2. Controlling the man Page Display

The man  command uses a "pager" to display documents. Normally this pager is The less  command, but on some distributions it could be The  more  command.

If you want to view the various movement commands that is available, you can type the letter while h viewing A man page. This would display a help page (Note:if is working on a Linux distribution that uses the more command as a P Ager, your output would be different than the example shown here):

If your distribution uses the less command, you might is a bit overwhelmed with the large number of "commands" th At is available. The following table provides a summary of the more useful commands:

Command Function
Return (or Enter) Go down one line
Space Go down one page
/term term Search for
N Find Next Search Item
1G Go to beginning
G Go to end
H Display Help
Q Quit man page

3. Sections of the man Page

Man pages is broken into sections. Each of the sections is designed to provide specific information about a command. While there is common sections that you'll see in the most mans pages, some developers also create sections that's you'll on ly see in a specific mans page.

The following table describes some of the more common sections so you'll find in mans pages:

Section
name Purpose
NAME Provides the name of the command and a very brief description.
Synopsis Provides examples of the command is executed. See below for more information.
DESCRIPTION Provides a more detailed description of the command.
OPTIONS Lists the options for the command as well as a description of how they is used. Often This information would be found in the DESCRIPTION section and not in a separate OPTIONS sections.
FILES Lists the files that is associated with the command as well as a description of what they are used. These files may is used to configure the command's more advanced features. Often This information would be found in the DESCRIPTION section and not in a separate OPTIONS sections.
AUTHOR The name of the person who created the man page and (sometimes.
REPORTING BUGS Provides details on what to report problems with the command.
COPYRIGHT Provides basic copyright information.
See ALSO Provides you to the where you can find additional information. This also would often include other commands that is related to the This command.

Part 2:man Pages categrized by Sections

Until now, we have been displaying mans pages for commands. However, sometimes configuration files also has a man pages. Configuration files (sometimes called system files) contain information that's used to store information about the Operat ing System or services.

Additionally, there is several different types of commands (user commands, system commands, and administration commands) As well as other features this require documentation, such as libraries and Kernel components.

As a result, there is thousands of mans pages on a typical Linux distribution. To organize all of these mans pages, the pages are categorized by sections, much as each individual mans page is broken in To sections.

By default there is nine default sections of man pages:

    1. executable programs or shell commands
    2. System calls (functions provided by the kernel)
    3. Librar Y calls (functions within program libraries)
    4. special files (usually found In  /dev )
    5. File formats and conventions, E.g. /etc/passwd
    6. Games
    7. Miscellaneous (including macro packages and conventions), E.g.man (7) ,  groff (7)
    8. System Administration commands (usually only for root)
    9. Kernel routines [Non standard]

man with the command, it searches each of these sections in order until it finds the first "match". For example, if your execute the command man cal , the first section (executable programs or shell commands) is searched F Or a man page called Cal. If not found, then the second section is searched. If No man page was found after searching all sections, you'll receive an error message:

1. Determining Which section

To determine which section a specific mans page belongs to, look at the numeric value on the first line of the output of th E man page. For example, if you execute the command, you'll see that man cal the cal command belongs to the first sectio N of man pages:

2. sepcifying a section

In some cases, you'll need to specify the section on order to display the correct man page. This is necessary because sometimes there would be a man pages with the same name in different sections.

For example, there is a command called this allows you to the change passwd your password. There is also a file called this passwd  stores account information. Both the command and the file has a man page.

The passwd command is a "user" command, so the command would display the man page for the man passwd passwd Comm And by default:

To specify a different sections, provide the number of the section as the first argument of the Man command. For example, the command would look for the man 5 passwd passwd mans page just in section 5:

3. Searching Sections

Sometimes it isn ' t clear what sections a man page was stored in. In cases-like this, you can search for a mans page by name.

The -f option to the man command would display man pages this match, or partially match, a specific name and pro Vide a brief description of each mans page:

Note that in most Linux distributions, the whatis command does the same thing as on man -f. those distributio NS, both would produce the same output.

4. Searching mans Pages by Keyword

Unfortunately, you won ' t always remember the exact name of the "The Man" page, the want to view.  In these cases you can search for mans pages that match a keyword by using the -k option man to the command.

For example, what if you knew your wanted a man page this displays how to change your password, but you didn ' t remember the Exact name? You could run the command man -k password :

When you use the This option, the large amount of output with a. The preceding command, for example, and provided over results.

Recall that there is thousands of man pages, so when you search for a keyword, is as specific as possible. Using a generic word, such as "the" could result in hundreds or even thousands of results.

Note that in most Linux distributions, the apropos command does the same thing as man -k . On those distributions, both'll produce the same output.

Part 2:info Command

Man pages is great sources of information, but they does tend to has a few disadvantages. One example of a disadvantage is, and each of the man page is a separate document, the not related to any other mans page. While some man pages has a see ALSO sections that could refer to other mans pages, they really tend to be unrelated sources O F documentation.

The info command also provides documentation on operating system commands and features. The goal of this command was slightly different from man pages:to provide a documentation resource that provides a logical Organizational structure, making reading documentation easier.

Within info documents, information is broken down into categories so work much like a table of contents so you would f IND in a book. Hyperlinks is provided to pages with information on individual topics for a specific command or feature. In fact, all of the documentation are merged into a single ' book ' in which can go to the top level of documentation and View the table of contents representing all of the documentation available.

Another advantage of info over mans pages is, the writing style of info documents is typically more conducive to Learni Ng a topic. Consider man pages to being more than a reference resource and info documents to being more than a learning guide.

Linux-getting Help

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.