access to help documents
External command: There is an executable program , located in a file system directory, you can use which, Whereis command query to the location of the command store.
- The path of the shell program search executable file is defined in the PATH environment variable, from left to right, and using the # echo $PATH command to view.
1. Get internal command help:
Format: # Help COMMAND
A.hash command:
Command format:hash [-LR] [-P path name] [-DT] [name ...]
The path result of the external command that the shell has searched for is cached into the KV (key-value) store;
Options:
- -R Forget all places to remember
B.history command:
Function: Management command history;
When you log in to the shell, the commands that are recorded in the command history file are read: ~/.bash_history
The newly executed commands are only recorded in the cache when logged into the shell, and are "appended" to the command history file when the user exits;
Options:
- -A: Append the newly executed command history list to the history file in this session;
- -D: Deletes the command specified in the history;
- -C: Clears the command history;
Quick action:
- !#: Call the section # command in history;
- !string: Invokes the last command in history that starts with a string;
- !: previous command;
2, external command to help obtain:
Format: # man COMMAND
Manual page Location:/usr/share/man
The man command has man1~man8,8 levels of help documentation:
- Man1: User Commands
- Man2: System call
- MAN3:C Library Call
- MAN4: Equipment files and special files
- MAN5: Configuration file format
- Man6: Games
- MAN7: Miscellaneous
- MAN8: Commands for managing classes
See the Manual in Chapter #: Man# COMMAND
The paragraph description in the Help manual:
- Name: explanation of the names
- Synopsis: Usage rules
- []: Optional content
- <>: Required Content
- A|b: Two Choose one
- ...: The same content can appear multiple times
- DESCRIPTION: Description of the relevant (option) usage
How to operate the man command:
function key |
function |
SPACEBAR, ^v, ^f, ^f |
display the next screen of the man page |
enter key, ^n, E, ^e or J or ^j |
one scroll man page A line of |
y, ^y, ^p, K, ^k |
to the header of the file |
B, ^b |
rollback one screen |
D, ^d |
turn half screen to file footer |
U, ^u |
turn half screen to file header |
f |
roll forward one screen |
q |
exit man command |
h |
list all function keys |
/word |
Search word string |
# |
jump to # line |
1g |
Back to file header |
G |
Turn to end of file |
Text Search:
- /keyword: Searches the end of the file from the current position with the string specified by KEYWORD, and does not distinguish between case-insensitive characters;
- ? KEYWORD: The string specified by the KEYWORD keyword, from the current position to the file header search;
- N: Same direction as search command, next
- N: Follow the search command in the opposite direction, previous
linux--Help Document Acquisition