Xshell shortcut key (very practical), xshell is very practical
Delete
Ctrl + d Delete the character at the cursor position, which is equivalent to x or dl in VIM
Ctrl + h Delete the character before the cursor position, which is equivalent to hx or dh in VIM
Ctrl + k Delete All characters after the cursor, equivalent to d shift + $ in VIM
Ctrl + u Delete All characters before the cursor, which is equivalent to d shift + ^ in VIM
Ctrl + w Delete the word before the cursor, which is equivalent to db in VIM
Ctrl + y resume ctrl + u characters deleted during last execution
Ctrl +? Undo previous input
Alt + r undo the previous action
Alt + d Delete the word after the cursor position
Mobile
Ctrl + a move the cursor to the beginning of the command line, which is equivalent to shift + ^ in VIM
Ctrl + e moving the cursor to the end of the command line is equivalent to shifting in VIM + $
Ctrl + f move the cursor one character backward, equivalent to l in VIM
Ctrl + B move the cursor forward a character equivalent to h in VIM
Ctrl + left arrow key move cursor to the beginning of the previous word
Ctrl + Right-click the arrow key and move the cursor to the end of the last word
Ctrl + x jump between the character of the last cursor and the character of the current cursor
Alt + f jump to the cursor position end of the word
Replace
Ctrl + t Replace the current character of the cursor with the previous character
Alt + t exchange the current position of the cursor and the word before the cursor
Alt + u converts words at the current position of the cursor to uppercase
Alt + l convert the word at the current position of the cursor to lowercase
Alt + c converts the first letter of the word at the current position of the cursor to uppercase.
^ Oldstr ^ newstr Replace the string in the previous command
Edit History commands
Ctrl + p returns the last input command character
Ctrl + r enter the word search history command
Alt + p
Alt +> returns the Last Command executed
Others
Ctrl + s lock Terminal
Ctrl + q unlock Terminal
Ctrl + l clear screen is equivalent to the command clear
Ctrl + c start another line
Ctrl + I is similar to the TAB key filling function
Ctrl + o repeated Command Execution
Alt + number of key operations
Actual Operation: # c + l clear screen first
Minuit @ suse: ~> Str1 str2 str3 # Enter three words and find that the first word must be capitalized, jump to the beginning, and press a + c
Minuit @ suse: ~> Str1 str2 str3 # Now the word looks like this, and it is found that the second word should be in uppercase (such a command is really dead :() well, if your current cursor is in the second word, a + u will change the word directly, if not, press "c + a" and then "c + f" to the second word, and then "a + u". The result is OK, as shown below.
Minuit @ suse: ~> Str1 STR2 str3 # What should I do if I want to change it? My position is already in the last word. It's easy to hold down a + 2 + B. Haha, I jumped to the second word, and then I came back with a + l, the second word. all in lower case
Minuit @ suse: ~> Welcome to chinaunix! # Isn't it case-sensitive? Press c + a and then a + 3 + c to check the effect.
Minuit @ suse: ~> Welcome To Chinaunix! # GOOD
Let's try another replacement.
Minuit @ suse: ~> Welcome To Chinaunix! # The three words c + a should jump to the beginning and then to the second word (because a + t can only be replaced with the previous word, so it is not allowed to press a + t in the first word) hold down a + t
Minuit @ suse: ~> To Welcome Chinaunix! # Now it's like this. If I use a + 2 + t, it's a different one.
Minuit @ suse: ~> Chinaunix! Welcome To # better.
Minuit @ suse: ~> Ls/tmp/# Check what
File1 file2 file3 .......
Minuit @ suse: ~> ^ Ls ^ cd # now, if you want to enter the directory again, you can simply run the "jian" command to replace it. If you use this command for a long time, you can save a lot time
Cd/tmp/
Minuit @ suse:/tmp> # enter the tmp directory.
Skip the command and you will not be able to try it yourself.
------------------------------------------------------------------------------
Ctrl + a can be quickly switched to the beginning of the command line
Ctrl + e switch to the end of the command line
Ctrl + r search in History commands
Ctrl + u Delete All characters before the cursor position
Ctrl + k Delete All characters after the cursor position
Ctrl + w delete a word before the cursor
Ctrl + d end current input and exit shell
Ctrl + s can be used to stay on the current screen ctrl + q resume screen Flushing
Ctrl + l clear screen
Shortcut Keys related to the ctrl key:
Ctrl + a-Jump to the start of the line
Ctrl + B-Move back a char
Ctrl + c-Terminate the command // is the most commonly used?
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 the screen, similar to the Clear command
Ctrl + r-Search the history backwards // find the history command
Ctrl + R-Search the history backwards with multi occurrence
Ctrl + u-Delete backward from cursor // useful when the password is incorrect
Ctrl + xx-Move between EOL and current cursor position
Ctrl + x @-Show possible hostname completions
Ctrl + z-Suspend/Stop the command
Supplement:
Ctrl + h-delete the current character
Ctrl + w-delete the last entered word
Shortcut Keys related to the ALT key:
It is rarely used at ordinary times. Some are in conflict with remote login tools.
Alt + <-Move to the first line in the history
Alt +>-Move to the last line in the history
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 is useful if it is not configured.
Other specific key bindings:
Enter bind-P to view all keyboard bindings. I think this series is more practical.
Here "2 T" means Press TAB twice
$2 T-All available commands (common) // command line completion, which I think is the best use of Bash
$ (String) 2 T-All available commands starting with (string)
$/2 T-Entire directory structure including Hidden one
$./2 T-Only Sub Dirs inside including Hidden one
$ * 2 T-Only Sub Dirs inside without Hidden one
$ ~ 2 T-All Present Users on system from "/etc/passwd" // It is easy to use
$2 T-All Sys variables // very useful when writing Shell scripts
$ @ 2 T-Entries from "/etc/hosts" // first time
$ = 2 T-Output like ls or dir // It seems to be less efficient than ls
Supplement:
Esc + T-swap two words before the cursor
Table 2-1 keys used to browse command lines
Press key |
Full name |
Description |
Ctrl + F |
Forward character |
Move one character forward |
Ctrl + B |
Character backward |
Move one character backward |
Alt + F |
Forward word |
Move a word forward |
Alt + B |
Word backward |
Move one word backward |
Ctrl + |
Line Header |
Start of the current row |
Ctrl + E |
End of line |
To the end of the row |
Ctrl + L |
Clear Screen |
Clear the screen and leave a line at the top of the screen |
The keys in Table 2-2 can be used to edit command lines.
Table 2-2 edit command line keys
Press key |
Full name |
Description |
Ctrl + D |
Delete current content |
Delete current character |
Backspace or Rubout |
Delete previous content |
Delete the previous character |
Ctrl + T |
Change character |
Swap the position of the current character and the previous character |
Alt + T |
Change words |
Swap the location of the current word and the previous word |
Alt + U |
Uppercase words |
Converts the current word to uppercase. |
Alt + L |
Lowercase words |
Change the current word to lowercase. |
Alt + C |
Uppercase letters |
Converts the first letter of the current word to uppercase. |
Ctrl + V |
Insert special characters |
Add special characters. For example, you can press Ctrl + V + Tab to add a Tab character. |
You can use the keys in Table 2-3 to cut and paste text on the command line.
Table 2-3 cut and paste text keys on the command line
Press key |
Full name |
Description |
Ctrl + K |
Cut the end of a row |
Cut the text to the end of the row |
Ctrl + U |
Cut row Header |
Cut the text to the beginning of the line |
Ctrl + W |
Cut the previous word |
Cut a word before the cursor |
Alt + D |
Cut the next word |
Cut the word behind the cursor |
Ctrl + Y |
Paste recent text |
Paste the recently cut text |
Alt + Y |
Paste earlier text |
Loop to the previously cut text and paste it |
Ctrl + C |
Delete the entire row |
Delete a whole row |
Table 2-4 keys used for text completion
Key combination |
Used |
Alt + ~ |
Complete text with user name |
Alt + $ |
Complete text with variables |
Alt + @ |
Complete text with host name |
Alt +! |
Complete the text with the command name (check in order of Alias, reserved word, shell function, shell built-in command, and file name. In other words, use commands that have been run before to complete the key sequence. |
Ctrl + X +/ |
List possible supplemented username text |
Ctrl + X + $ |
List possible completion Environment Variables |
Ctrl + X + @ |
List possible completion host names |
Ctrl + X +! |
List possible completion command names |
Table 2-5 commands
Key |
Merit name |
Description |
Direction key (Primary or secondary) |
Step by step |
Click the top and bottom arrows to browse each command line in the History list until the required position (Ctrl + P and Ctrl + N have the same function) |
Ctrl + R |
Reverse progressive search |
Press these keys and enter a search string for reverse search. After this string is entered, the matched command line will appear. You can run or edit it. |
Ctrl + S |
Forward and progressive search |
Similar to the previous function, it is only a forward search |
Alt + P |
Reverse search |
Press these keys and enter a string for reverse search. Enter a string and press Enter to view the recently used commands that contain the string. |
Alt + N |
Forward search |
Similar to the previous function, it is only a forward search |
Alt + < |
The beginning of the History List |
The first item in the History List |
Alt +> |
End of History List |
To the last item in the History List |
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.