From: http://blog.sina.com.cn/s/blog_7556be720100ryp2.html
CTRL + P repeat the previous command
CTRL + a jump to the first character
CTRL + x same as above, but once again, it will return to the original location
CTRL + B move one character forward without deleting characters
CTRL + H Delete the previous character
CTRL + u Delete All characters before the prompt
CTRL + W same as above
CTRL + D Delete the character after the prompt, or exit or logout
CTRL + E to the end of the character
CTRL + F move one character behind
CTRL + k Delete All characters after the prompt
CTRL + k cancel
CTRL + R: used commands for forward lookup
CTRL + O Ctrl + y Ctrl + I crtl + M do not know how to use
<Tab> command completion
CTRL-I is equivalent to pressing a tab <tab> key
The CTRL-W is not removing all characters before the cursor, it removes a word before the cursor
The CTRL-P is recall the previous command, the CTRL-N is recall the next command
ESC-F cursor stepping forward a word
ESC-B cursor stepping backward a word
CTRL-M is equivalent to a carriage return key
CTRL-O is equivalent to a carriage return key
The CTRL-V enables the next special character to be inserted at the current position, for example, the CTRL-V <tab> can insert a <tab> character at the current position, where ASCII is 9, otherwise, the result is a command completion by pressing <tab>.
The CTRL-C removes the edit of the current command line from another line.
The CTRL-S temporarily freezes the input of the Current Shell
CTRL-Q unfreeze
ESC-C: make the first letter of the next word in uppercase, and move the cursor forward to a word. For example, if the cursor stays on a letter of the word, for example, the o letter in the word, the o letter is changed to uppercase.
ESC-u converts all the letters of the next word to uppercase, And the cursor moves forward to a word. Same as above, if the cursor is on the O letter, the Ord is capitalized, and W remains unchanged.
ESC-L is the same as the ESC-U, but make it all lowercase.
I tried all the CTRL keys in bash and summarized them as follows (all the keys listed below are CTRL keys ):
1. U K Y
U deletes the characters before the cursor (not included)
K. Delete characters after the cursor (included)
Y sticks out the deleted characters.
2. d H
D. Delete the character at the cursor.
H. delete a character before the cursor
3. A E
A move the cursor to the beginning of the line
E move the cursor to the end of the row
4. F B
F move the cursor one character to the right
B. move the cursor to the left of a character.
5. N P
N next command
Command on P
6. L
L clear screen
7. r
R search for commands previously entered
8. T
T Replace the character at the cursor with the character before the cursor
Basic skills:
View command history with up/down keys
Left/right key area modification content
Tab to fill in the command name or directory. The file name is not unique. Press twice to display the list.
! Ls re-runs the last command starting with 'LS'. If ls-l is first followed by ls-lcrt, then! Ls, equivalent to ls-lcrt
Ls abc.txt
Vi! $
Vi in the second line! $ Is equivalent to vi abc.txt ,! $ Is equal to the parameter of the previous command. '$' is the last row and column in the context.
Ctrl key combination
Ctrl + a: move the cursor to the beginning of the line.
Ctrl + B: move the cursor to the left
Ctrl + c: Kill the current process.
Ctrl + d: exit the current Shell.
Ctrl + e: move the cursor to the end of the row.
Ctrl + h: Delete the character before the cursor, which is the same as the backspace key.
Ctrl + k: Clear the content from the cursor to the end of the row.
Ctrl + l: clear screen, equivalent to clear.
Ctrl + r: Search for commands that have been used before. There will be a prompt to search based on the keywords you enterBashHistory
Ctrl + u: Clear all content from the front of the cursor to the beginning of the line.
Ctrl + w: Remove a word before the cursor
Ctrl + t: two characters before the cursor position
Ctrl + y: paste or restore the last Deletion
Ctrl + d: Delete the letter where the cursor is located. Note the difference with backspace and ctrl + h. The two are the characters before the cursor is deleted.
CTRL + F: move the cursor right
CTRL + Z: run the current process in the background and run the 'fg' command to restore the process. For example, top-D1, CTRL + Z, go to the background, then FG, and restore
ESC combination
ESC + D: delete a word after the cursor
ESC + F: Jump to the right
ESC + B: Jump to the left
ESC + T: swap two words before the cursor position.