"Linux use" Bash Shell command line common shortcut keys (reprint)

Source: Internet
Author: User
Tags clear screen

Ctrl + A: Moves to the beginning of the currently edited command,

Ctrl + E: Moves to the end of the currently edited command line,

Ctrl + F or->: move by word aligns (toward the end of the command line, forward)

Ctrl + B or <-: Moves left by character (toward the end of the command line, and then backwards)

Alt + F: Move right by word (toward end of command line, forward)

Alt + B: Moves left by word (toward the beginning of the command, then back)

Edit:

Ctrl + C: Delete entire row

Ctrl + L: Clear screen, equivalent to clear

Ctrl + U: Introduction to the content of the cursor position to the beginning of the line (including itself), later can be ctrl+y pasted

CTRL + K: Cuts the cursor position to the end of the line (including itself) and can be pasted later with Ctrl + Y

  

CTRL + W: Cut from the cursor position to the starting position of the current word, and you can paste it later with Ctrl + Y

Alt + D: Cut from the position of the cursor to the end of the current word, you can later paste with Ctrl + Y

Ctrl + Y: After pasting into the cursor

  

Historical command-Related:
  

    • !! : Executes the previous command, so the quick sudo method is sudo!!
    • !blah: Executes the most recent command starting with Blah, such as!ls
    • !blah:p: Print output only, without performing
    • !$: The last parameter of the previous command, with Alt +. Same
    • !$:p: Print out the contents of the!$
    • !*: All parameters of the previous command
    • !*:p: Print out the contents of the!*
    • ^blah: Delete blah from previous command
    • ^blah^foo: Replace blah in the previous command with Foo
    • ^blah^foo^: Replace all blah in the previous command with Foo

Ctrl+p: Previous command (UP ARROW)

CTRL + N: Next command (down arrow)

Historical Command Search:

Ctrl+r: Enter a number of characters (keywords) that will search for historical commands that contain the keywords you have entered. Continuing to press Ctrl+r will continue to search for historical commands that contain keywords. Once the target command is found, you can press ENTER directly to execute the found command. If you still want to modify the parameters, you can press the right arrow.

Ctrl+g: Jump out of Ctrl+r's search mode

"Linux use" Bash Shell command line common shortcut keys (reprint)

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.