Linux basic commands 4 - Linux shortcut keys and help commands

Table of contents

Linux shortcut keys

Linux commonly used help commands

help command - only applicable to built-in commands

--help command - only applies to external commands

Help commands available internally and externally

man command

info command


Linux shortcut keys

 ctrl+shift+plus sign to enlarge the screen

 ctrl+minus sign shrink the screen

 ctrl+l clear screen

 tab completes commands and parameters

 ctrl+c terminates the running of the current program

 ctrl+d indicates the end of keyboard input

 ctrl+a moves the cursor to the beginning of the line

 ctrl+e moves the cursor to the end of the line

 ctrl+u deletes everything from the cursor to the beginning of the line

 ctrl+k deletes everything from the cursor to the end of the line

 ctrl+w deletes the word before the cursor

 ctrl+r search history commands

Shut down/restart the system

reboot Restart the system

poweroff shut down the system


Linux commonly used help commands

help command - only applicable to built-in commands

       Use the format: help name of the built-in command

--help command - only applies to external commands

       Use the name of the format external command --help

Help commands available internally and externally

man command

Format: man [Parameter] Command name

The man command is the abbreviation of manual and is used to view help documents for internal/external commands in the system.

The help manual of linux commands is stored in a compressed form under a specific path for everyone to use, saving space.

 -a displays all matches

 -d displays the path to the help document corresponding to the command, but does not display the document content.

 -D displays the path to the help document corresponding to the command and displays the document content

 -h displays help information

 -f Same as whatis, search for help index information starting with keywords

 -C specifies the man command to search for configuration files; the default is man.config

 -K searches all manuals for this string

 -M specifies the path to search for manuals

 -P pro Use pro program to display manual page; default is less

 -B pro Use pro program to display HTML man page; default is less

Help document storage path

The /usr/share/man folder stores command help documents. The folder will be partitioned according to different functions of the document.

oil 1

user command

man2

System call command

man3

Some commonly used functions and function libraries (mostly C function libraries)

man4

device file

man5

Configuration file format

man6

game

man7

Miscellaneous

man8

Administrative commands available to system administrators

man9

Files related to the kernel

You can use the whereis command to view the storage path of the help document corresponding to the command.

Man command operation principle

The man command is to decompress the compressed file to a temporary directory, and then use the less program to call the help manual

Therefore, you can use all options of the less command when viewing the help documentation through man.

How to use man

How to operate man

Enter/pagedown

Move down one line

y/pageup

move up one line

space bar

Scroll down one screen

b

Scroll up one screen

?

Function to search up for "string"

/

Ability to drill down for "string"

n

Find what to search for next

q

Exit; browsing to the last page will not automatically exit. You need to enter q to exit.

Paragraph description in the help manual

SYSNOSIS

Usage format description

DESCRIPTION

Detailed description

OPTIONS

Option description

EXAMPLES

Example

FILES

Related documents

AUTHOR

author

COPYRIGHT

Version Information

REPORTING BUGS

BUG information

SEE ALSO

Other help references

info command

Format: info [Parameter] Command name

 -k string/--apropos=string Find the string in the corresponding command manual

 -d directory/ --directory=directory path Add a directory containing info format help documents

 -h/--help Display help information and exit

 --index-search=string Go to the node pointed to by the index entry which is a string

 -o file path/--output=file path Output the contents of the selected node to the file

 -R/--raw-escapes output raw ANSI escape characters (default is)

 --no-raw-escapes Output escape characters for text types

 --version Show version and exit

 -w/--where/--location displays the storage path of the info file corresponding to the command

The help documentation of commands viewed through the info command is more comprehensive. The help documents viewed through the info command are all in info format, but they are also compressed files.

The help document displayed through the info command is easier to understand, and the information displayed is provided in a book-like manner (displayed according to node-chapter classification)

Info format help document storage path

Stored in the /usr/share/info folder

info display content

File: document name

Node: current node (chapter) of the document

Next: The next node (chapter) of the document

Up: The previous node (chapter) of the document

How to operate info

space

Scroll down; after reaching the end of the node, enter the next document node

backspace

Scroll upward; after reaching the top of the node, enter the previous document node

n

Enter the next node at the same level as the current one

p

Enter the previous node of the same level

t

Enter the top node

u

Enter the previous layer (previous level) node

b

Move to the top of this node

i

List all index titles of the document, select one of the titles to enter

m

If the node contains a directory (often the index of the next-level node), a prompt is given to choose to enter.

l (lowercase l)

Go back in browsing history (equivalent to going back in the browser)

Guess you like

Origin blog.csdn.net/m0_49864110/article/details/134018719