linux--Help Document Acquisition

Source: Internet
Author: User

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;
      • N: Next
      • N: Previous
    • ? 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

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.