Shell shortcut keys under Linux

Source: Internet
Author: User
Tags clear screen

Ctrl+p repeat the last command
CTRL + a jumps to the first character
Ctrl+x, but press again to return to the original position.
Ctrl+b move forward one character without deleting the character case
Ctrl+h Delete the previous character
Ctrl+u all characters before the prompt is deleted
Ctrl+w Ibid.
Ctrl+d Delete prompt after a character or exit or logout
Ctrl+e go to character trailing
Ctrl+f move back one character
Ctrl+k Remove all characters after a prompt
Ctrl+k Cancel
Ctrl+r looking forward to used commands
Ctrl+o ctrl+y Ctrl+i Crtl+m These 4 don't understand how to use
<TAB> Command Completion
Ctrl-i is equivalent to pressing the TAB <TAB> key
Ctrl-w does not delete all characters before the cursor, it deletes a word before the cursor
Ctrl-p is recall out the last command <===> Ctrl-n is recall out the next command
ESC-F cursor forward one word
Esc-b cursor to step backward one word
Ctrl-m equals the Enter key
Ctrl-o equals the Enter key
CTRL-V enables the next special character to be inserted in the current position, such as ctrl-v <TAB> can insert a <TAB> character at the current position, its ASCII is 9, otherwise the <TAB> result is usually ordered to be padded
Ctrl-c undo the editing of the current command line, starting with another line.
Ctrl-s temporarily freezes the input of the current shell
CTRL-Q Thaw
Esc-c the first letter of the next word, while the cursor advances a word, such as when the cursor rests on a letter of the word, such as the O letter in Word, the O letter is capitalized. And not W.
Esc-u the next word all the letters into uppercase, while the cursor forward a word, ditto, such as the cursor on the O letter, then ord to uppercase, W unchanged.
Esc-l with Esc-u, but makes it all lowercase.
Try all the CTRL keys in bash and summarize the following (all keys that appear below are CTRL key combinations):

1. U K Y
U remove the previous characters from the cursor (not included)
K Delete the next character of the cursor (including)
Y Glue the characters you just removed

2. D H
D Delete the character at the cursor
H remove one 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 line

4. F B
F move the cursor to the right one character's position
b move the cursor to the left one character position

5. N P
N Next command
P Previous Command

6. L
L Clear Screen

7. R
R Search for previously entered commands

8. T
T replaces the position of the character at the cursor and the previous character of the cursor

Basic:
Use the up and down keys to see the history of commands
Modify content around the key area
Tab completion command name or directory, file name, not the only multiple press 2 times, will come out of the list
!ls repeat the last command that starts with ' ls ', if ls-l and then Ls-lcrt, then!ls, equivalent to LS-LCRT

LS Abc.txt
VI!$

The second line of VI!$ is equivalent to the abc.txt,!$ of the previous command, and ' $ ' is the last row, column, and so on the context.

CTRL key combination
CTRL + A: The cursor moves to the beginning of the line.
CTRL+B: The cursor moves left one letter
CTRL + C: kills the current process.
Ctrl+d: Exits the current Shell.
Ctrl+e: The cursor moves to the end of the line.
Ctrl+h: Deletes the previous character of the cursor, same as the BACKSPACE key.
Ctrl+k: Clears the contents of the cursor to the end of the line.
Ctrl+l: Clear screen, equivalent to clear.
Ctrl+r: Search for previously played commands. There will be a hint to search for the history of Bash based on the keywords you entered
Ctrl+u: Clears all content before the cursor to the beginning of the line.
Ctrl+w: Remove a word before the cursor
Ctrl+t: Swap two characters before the cursor position
Ctrl+y: Paste or restore the last delete
Ctrl+d: Delete the letter of the cursor, note the difference between backspace and ctrl+h, and these 2 are the characters before the cursor is deleted.
CTRL+F: Cursor Right Shift
CTRL + Z: Move the current process to the background and use the ' FG ' command to recover. Like top-d1 then CTRL + Z, into the background, then FG, re-restore
ESC Combination
Esc+d: Delete A word after the cursor
Esc+f: Jump Right One word
Esc+b: Jump to the left one word
Esc+t: Swap The two words before the cursor position.

Shell shortcut keys under Linux

Related Article

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.