Linux: Help commands, man, info

Source: Internet
Author: User

The note reads as follows:

1, built-in command and external command of the Division
2. Use and difference of help, man, info command

Built-in commands and external commands

There are some tools for viewing help that are treated differently on built-in commands and out-of-the-way commands.

The built-in commands are actually part of the shell program, which contains simple Linux system commands written in the builtins of the bash source, identified by the shell program and run inside the shell, usually when the Linux system is loaded The shell is loaded and resides in system memory. and parsing the internal command shell does not need to create a child process, so it executes faster than an external command. For example: History, CD, Exit and so on.

External commands are part of a utility in a Linux system, because the utility is usually powerful, so it contains a large number of programs that are not loaded into memory with the system when the system is loaded, but instead being transferred into memory when needed. Although it is not included in the shell, its command execution process is controlled by the shell. External commands are installed outside of Bash, usually on/bin,/usr/bin,/sbin,/usr/sbin, and so on. For example: LS, vi and so on.

We can use the type command to differentiate whether the command is built-in or external. For example, the two results are different.

# The result is that the built-in command, as stated above, is builtins in the bash source. def  is a shell builtin # The result is an external command, as stated above, the external command is in/usr/bin or/usr/sbin, etc.  is/usr/bin/xxx# If you get the result of alias, it indicates the name set by the command alias; is XX--xxx

Help commands

1. Help command

# Help xxx can only be used for internal commands and cannot be used for external commands $help CD DHSAFKDSJFAKJSDGJKASDBKJDSBFASDFDSFDSAGSDGSDGSDGASDGASDGDSAGDSAGDSGDAGSDGDSG (a bunch of help documents) $help LS not with "LS" Match xxxx#  xxx--help for external command $ls--  HELPDHSAFKDSJFAKJSDGJKASDBKJDSBFASDFDSFDSAGSDGSDGSDGASDGASDGDSAGDSAGDSGDAGSDGDSG (a bunch of help documents)

2. Man command

$man ls

The resulting content is more detailed than help, and man has no distinction between built-in and external commands , because the man tool is the display of the contents of the System manual page, which is an electronic version of the dictionary, most of which is the interpretation of the command, and some related descriptions. You can also get more information about the program and more features of Linux by looking at the man in the system documentation.

When we try this command we will find that the upper left corner shows "LS (1)", where "ls" denotes the manual name, and "(1)" indicates that the manual is in the first chapter. What is this chapter? There are so many chapters in the Man Handbook.

Chapter number Description
1standard commands (Standard command)
2system calls (System call)
3library functions (library function)
4special devices (device description)
5file formats (file format)
6Games and Toys (games and entertainment)
7miscellaneous (Miscellaneous)
8administrative Commands (Administrator command)
Span style= "font-family:"microsoft yahei"" >9 Other (Linux-specific) documents used to store kernel routines.
After opening the manual we can go up and down through PgUp and PgDn or up and down, you can press Q to exit the current page

3. Info command

$info ls

With more information than man, info comes from the GNU project of the Free Software Foundation and is the GNU hypertext Help system that displays the GNU message more fully. So the information you get is certainly more

Man and info are like two collections, they have an intersection part, but compared with man, the info tool can display more complete GNU tool information. If the man page contains an overview of a tool that is also described in info, then the man page will have the words "please refer to info page for more details".

Source: Laboratory Building
Links: https://www.shiyanlou.com/courses/1

Linux: Help commands, man, info

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.