Linux get help information for commands

Source: Internet
Author: User
Tags what header

To determine whether a command is built into Linux, you can use the Type command, and only the Linux built-in commands can be used to get help.
# Type cd
Output: CD is a shell builtin
Note that this command is a built-in command from the system, so you can use the help command to get assistance.

# Help Command name

< two >, external commands How to get help documents:

(1) The first option is to use--help

Format: # command name--help

Example: # mkdir--help

(2) You can use the man command to get complete help for a command

Format: # man command name
Example: # man mkdir
The man command is to invoke the less tool to display the document, and man's specific operation method is the same as less.

Common uses of Linux man: 
Man-section cmd:directlySpecify a Search man page in a specific section, such asMans 5 passwdHelp for direct access to file format version
man-a cmd:Openhelp with the same name in all sections, for example Man–a passwd, you will first enter a passwd (1) command version passwd Help, you press the Q key will enter passwd (5), passwd configuration file format Help
man-aw cmd:ShowAll cmd file paths for all manuals, such as Man-aw passwd is
/usr/share/man/man1/passwd.1.gz
/usr/share/man/man5/passwd.5.gz
man-m cmd:Specify the search path for the manual file, such as Man-m/home/mysql/man MySQL display is the help of your installed MySQL, not the system comes with the old version of MySQL help
Man cmd| col-b > Cmd.txt: Output man manual information to a text file

Man Simple introduction: 
The man in Linux is very powerful, and the manual is divided into sections, which can be used to specify a different section to navigate, with each section having the following meanings:

    • 1 – User Commands General user command

    • 2-system Calls system invoke command, such as Open,write (through this, at least it can be easily found to call this function, need to add what header file)

    • li>

      3-c Libraries Functions C function library commands, such as Printf,fread

    • 4-devices and special files are special files, which is the various device files under/dev &NB Sp


Man command format: 
Man [option] Name:name is generally the name of the Help document, corresponding to command name, function name, or configuration file name (with suffix!) ), such as
Man nsswitch.conf: View the Help documentation for the/etc/nsswitch.conf file
Man networks: View the Help documentation for the/etc/sysconfig/networks file

to view the help documentation for a specific language version:set the environment variable LANG=ZH_CN before executing the man query

Man 's configuration file/etc/man.config: 
If you don't want to specify the path with-M every time man cmd, you can modify the configuration file to add content such as
Manpath/home/mysql/man


Linux get help information for commands

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.