Use the type command first to determine whether it is an internal command or an external command
Getting commands to use in Linux helps:
Built-in command: Use Help
~]# Help COMMAND
External command:
(1) Help with the use of the command's own brief format
~]# Commmand--help
[]: Indicates optional;
... : indicates can be multiple;
(2) User manual (manual)
Storage location:/usr/share/man/
Chapters: Man1, Man2, ..., man8
Format: The compression format is generally stored, saving space;
Includes help for commands, help with configuration files for commands, etc.;
~]# Mans KEYWORD
description of each part of the function:
Section :
Name: Description of the command and its function;
Synopsis: Basic use syntax for commands;
DESCRIPTION: Detailed description of the information;
options: Command-related parameter option description;
AUTHOR: Author;
BUGS: A way to report a bug in a program;
EXAMPLES: use example;
See ALSO: Additional reference;
files: Related configuration files;
Synopsis:
[]: Optional content;
<>: Content that must be provided;
A|b|c: choose one more;
... : Similar content can appear multiple times;
Man Chapter:
1 executable programs or shell commands user command help documentation;
2 system calls (functions provided by the kernel) systems call the Help documentation (functions provided by the kernel);
3 Library calls (functions within program libraries) libraries invoke help documents (functions provided by library programs);
4 special files (usually found In/dev) special documents help document;
5 file formats and conventions Help documentation for the format of the EG/ETC/PASSWD profile;
6 games game help documentation;
7 miscellaneous (including macro packages and conventions), e.g. man (7), Groff (7) Miscellaneous Help documentation;
8 System Administration commands (usually only for root) systems Management commands use the Help documentation;
9 Kernel routines [Non Standard] The Help document of kernel program code;
Note: When a command is sometimes in multiple chapters, the first retrieved chapter is displayed by default;
To view the specified chapters help:
~]# Man # KEYWORD
See which chapters of a keyword have a man handbook:
~]# Whatis KEYWORD
~]# man-f KEYWORD
Note: The Whatis execution process is to query the database, manually update the database;
~]# Makewhatis (requires installation of the command program, Centos7 is mandb)
options:
-K: keyword-based search related to user manuals, Search the description in each manual for
- K: Based on keyword search related is the user manual, search throughout the Help manual;
-f,--whatis: equivalent to Whatis command, dependent on Whatis database;
note: The man command first extracts the Help manual as a temporary file through the compression tool, The contents of the temporary file (Help book contents) are then displayed by calling the less command:
~]# man find: Get use Help;
Flip screen:
SPACEBAR, CTRL+F: Flip a screen to the end of the file;
Span style= "font-family:"microsoft yahei"; Font-size:16px "> b: Flip a screen to the file header;
D: Half screen to the end of the file;
u: half screen to file header;
Enter, ctrl+#: Flip a line to the end of the file;
Span style= "font-family:"microsoft yahei"; Font-size:16px "> y,k: Flip a line to the file header;
G: Jump to the last line;
#G: jump to Line #;
Keyword search:
/ KEYWORD: can use mode search: Search the end of the file;
n: Same as Find command direction ;
N: opposite to the lookup command;
Span style= "font-family:"microsoft yahei"; Font-size:16px "> exit:
Q:quit retreat The
Note: The man command will find the man manual on many paths;
In CentOS7 this path is the/etc/man_db.conf file, using "MANPATH" to specify the defined path;
In CentOS6 the path is in/etc/man.config;
Manually specify the path below to find the relevant keyword manual and display it;
~]# man-m/path/to/somedir KEYWORD
How to help with Linux commands