Delete
CTRL + D deletes the character at the cursor location equivalent to VIM x or DL
CTRL + H deletes the character in front of the cursor, which corresponds to the HX or DH in vim.
Ctrl + K Delete all characters after cursor equals vim d shift+$
CTRL + U delete all characters in front of the cursor equal to VIM D shift+^
CTRL + W DELETE cursor before a word equals vim in db
Ctrl + Y restores the characters that were deleted when Ctrl+u was last executed
CTRL +? Undo previous input
ALT + R undo Previous action
ALT + D Delete the word after the cursor position
Move
CTRL + A moves the cursor to the beginning of the command line equivalent to Vim shift+^
CTRL + E moves the cursor to the end of the command line at the equivalent of vim shift+$
CTRL + F cursor moves backwards one character equivalent to Vim in L
CTRL + B cursor moves forward one character equivalent to Vim in H
CTRL + ARROW key left cursor moves to the beginning of the previous word
CTRL + ARROW key right cursor moves to the end of the next word
CTRL + X jumps between the last character of the cursor and the character at which the current cursor is located
ALT + F jumps to the end of the word at the cursor position
Replace
CTRL + T replaces the current character of the cursor with one of the preceding characters
ALT + T swap two cursor at the current position of the word and the previous word of the cursor
ALT + U change the current position of the cursor to uppercase
ALT + L CHANGE the current position of the cursor to lowercase
ALT + C capitalizes the first letter of a word in the current position of the cursor
^oldstr^newstr Replace string in previous command
History command Edit
CTRL + P returns the last input command character
CTRL + R Enter Word search history command
ALT + P input character find history command close to Word typeface
ALT + > return to last Execute command
Other
CTRL + S lock Terminal
CTRL + Q unlock Terminal
CTRL + L clear screen equivalent to command clear
CTRL + C from another line
CTRL + I similar to tab completion function
CTRL + O repeat command
Number of ALT + number key operations
Actual operation: #c +l Clear Screen first
[Email protected]:~>str1 str2 str3 #输入三个单词发现第一单词需要大写好按c +a Jump to the beginning press A+c
[Email protected]:~> Str1 str2 str3 #好现在单词就变成了现在这个样子, and found the second word to all uppercase (such a command is really dead: () Well, if your current cursor is in the second word, that directly a+u the word change, if not, then hold c+a and then c+f jump to the second word, then A+u will be OK. The result is as shown below.
[Email protected]:~> Str1 STR2 str3 #我想换过来怎么办我的位置已经在最后一个单词这个好办按住a +2+b haha jump to the second word again a+l This second word is all lowercase.
[Email protected]:~> Welcome to chinaunix! #不就是变个大小写吗? Hold C+a and then a+3+c look at the effect.
[Email protected]:~> Welcome to chinaunix! #GOOD很简单
Let's try the replacement again.
[Email protected]:~> Welcome to chinaunix! #还是这三单词c +a jumps to the beginning and then jumps to the second word (because a+t can only replace a word in front of it so you can't press a+t in the first word) to hold a+t
[Email protected]:~> to Welcome chinaunix! #现在成这样子的了如果我用再按a +2+t, that's a change.
[Email protected]:~> chinaunix! Welcome to #好了来一点比较常用的
[Email protected]:~>ls/tmp/#看看下面有些什么
File1 file2 file3 ...
[Email protected]:~>^ls^cd #现在再又想进入目录很简单的健入替换命令就行了在命令很长时用这个替换可以省掉很多按a +b or a+f time
cd/tmp/
[Email protected]:/tmp> #进入了tmp目录了
Jump command will not try everyone's own experience can not see ^_^
------------------------------------------------------------------------------
Ctrl + A can quickly switch to the beginning of the command line
Ctrl + E To switch to the end of the command line
Ctrl + R to find in the history command
Ctrl + u Delete all characters before the cursor position
Ctrl + K deletes all characters after the cursor position
CTRL + W Deletes a word before the cursor
Ctrl + D ends current input, exits shell
CTRL + S can be used to stay in the current screen CTRL + Q recovery Brush screen
CTRL + L Clear Screen
CTRL key related shortcut keys:
Ctrl + A-jump to the start of the line
Ctrl + B-move back a char
Ctrl + c-terminate the command//use the most?
Ctrl + D-delete from under the cursor
Ctrl + E-jump to the end of the line
Ctrl + f-move forward a char
Ctrl + K-delete to EOL
Ctrl + l-clear The screen//clear, similar to the clear command
Ctrl + R-search The history backwards//Find historical command
Ctrl + R-search The backwards with multi occurrence
Ctrl + u-delete Backward from cursor//password input error when it is more useful
Ctrl + xx-move between EOL and current cursor position
Ctrl + x @-Show possible hostname completions
Ctrl + z-suspend/stop the command
Add:
Ctrl + H-delete the current character
Ctrl + W-delete the last word entered
ALT key related shortcut keys:
Seldom used in peacetime. Some conflicts with remote login tools.
Alt + <-Move to the first
Alt + >-Move to the last line in the
Alt +? -Show Current Completion list
ALT + *-Insert all possible completions
ALT +/-attempt to complete filename
Alt +. -Yank last argument to previous command
Alt + b-move Backward
Alt + C-capitalize The word
Alt + D-delete Word
Alt + F-move Forward
Alt + l-make Word lowercase
Alt + N-search The history forwards Non-incremental
Alt + P-search The history backwards Non-incremental
ALT + r-recall Command
Alt + t-move words around
ALT + u-make Word uppercase
Alt + back-space-delete Backward from cursor
SECURECRT if not configured properly, this will work.
Other specific key bindings:
Enter Bind-p to see all the keyboard bindings. I think this series is more practical.
Here "2T" means press TAB twice
$2t-all available commands (common)//command line completion, I think it's Bash's best use.
$ (String) 2t-all available commands starting with (string)
$/2t-entire directory structure including Hidden one
$./2t-only Sub Dirs inside including Hidden one
$ *2t-only Sub Dirs inside without Hidden one
$ ~2t-all Present Users on the system from "/etc/passwd"//first time seen, very useful
$ $2t-all Sys variables//very practical when writing shell scripts
$ @2t-entries from "/etc/hosts"//First time see
$ =2t-output like ls or dir//seems to be better than LS fast
Add:
ESC + T-swap two words in front of the cursor
Table 2-1 Navigating the command-line keystrokes
Hit key |
Name |
Meaning |
Ctrl+f |
Character Fu Xiangmai |
Move one character forward |
Ctrl+b |
Character backwards |
Move backward one character |
Alt+f |
Word forward |
Move forward one word |
Alt+b |
Word backwards |
Move one word backwards |
CTRL + A |
Outfit |
To the beginning of the current line |
Ctrl+e |
End of Line |
To the end of the line |
Ctrl+l |
Clear Screen |
Clear the screen and leave a line at the top of the screen |
The keystrokes in table 2-2 can be used to edit the command line.
Table 2-2 Edit command-line keystrokes
Ctrl+t
Keystroke |
Full name /td> |
Meaning |
ctrl+d |
Delete current content |
Delete current character |
Backspace or rubout |
Delete previous content |
Delete previous character |
Swap characters |
Swap the position of the current character and the previous character |
Alt+t |
Replace word |
Swaps the position of the current word and the previous word |
Alt+u |
Uppercase word |
Change the current word to uppercase |
Alt+l |
Lowercase words |
Change the current word to lowercase |
Alt+c |
First uppercase |
Capitalize the first letter of the current word |
Ctrl + V |
Insert special characters |
Add special characters. For example, press Ctrl+v+tab to add a tab character |
Use the keystrokes in table 2-3 to cut and paste text on the command line.
Table 2-3 keystrokes for cutting and pasting text on the command line
Hit key |
Name |
Meaning |
Ctrl+k |
Cut end of line |
Cut text to the end of the line |
Ctrl+u |
Cut the Wardrobe |
Cut the text to the beginning of the line |
Ctrl+w |
Cut a previous word |
Cut a word before the cursor |
Alt+d |
Cut the next word |
A word after clipping the cursor |
Ctrl+y |
Paste the most recent text |
Paste the recently cut text |
Alt+y |
Paste an earlier text |
Samsara to the previously cut text and paste it |
CTRL + C |
Delete entire row |
Delete a whole row |
Table 2-4 Key combination for text completion
Key combinations |
For |
alt+~ |
Complete text with user name |
alt+$ |
Complement text with variables |
[Email protected] |
Complement the text with a host name |
alt+! |
Complete the text with the command name (in order of aliases, reserved words, shell functions, shell built-in commands, and file names). In other words, complete the key sequence with a previously run command |
ctrl+x+/ |
List possible complete user name text |
ctrl+x+$ |
List possible completion environment variables |
[Email protected] |
List possible completion hostnames |
ctrl+x+! |
List possible completion command names |
Table 2-5 Keystrokes using the command history
Key |
Feature name |
Description |
Direction key (↑ or ↓) |
Step in |
Press the up and down arrows to step through each command line in the history list until the desired location (CTRL+P and CTRL + N have the same function respectively) |
Ctrl+r |
Reverse Incremental Search |
After you press these keys, enter a search string to reverse the search. After you enter this string, the matching command line appears, and you can run or edit it |
Ctrl+s |
Forward Progressive Search |
Similar to the previous function, except that it is a forward search |
Alt+p |
Reverse Search |
After you press these keys, enter a string to reverse the search. Enter a string and press ENTER to see the most recently used command containing the string |
Alt+n |
Forward Search |
Similar to the previous feature, except that it is a forward search |
alt+< |
The beginning of the history list |
To the first item in the History list |
Alt+> |
End of History list |
To the last item in the History list |
Xshell shortcut keys (very practical)