Linux Bash shortcut Keys Encyclopedia

Source: Internet
Author: User
Tags clear screen

First, edit the command

Ctrl + A: Move to the beginning of the command

Ctrl + E: Move to the end of the command line

Ctrl + F: Move forward by character (right)

Ctrl + B: Move back (left) by character

Alt + F: Move forward by word (right)

Alt + B: Move back by word (left)

Ctrl + XX: Move between the command line and the cursor

Ctrl + u: Remove from cursor to command line

Ctrl + K: Remove from cursor to end of command line

Ctrl + W: Remove from cursor to Word header

Alt + D: Remove from cursor to end of word

Ctrl + D: Deletes the character at the cursor

Ctrl + H: Delete characters before the cursor

Ctrl + y: Paste to Cursor

Alt + C: Change the word from the cursor to the capital letter

Alt + u: change from cursor to all uppercase words

Alt + L: Change from cursor to all lowercase words

Ctrl + t: Swap the cursor and previous characters

Alt + t: Swap the cursor and previous words

Alt + Backspace: Similar to Ctrl + W, delimiters somewhat different [thank Rezilla correction]

Second, control orders

Ctrl + L: Clear screen

Ctrl + O: Executes the current command and selects the previous command

Ctrl + S: Block screen output

Ctrl + Q: Allow screen output

Ctrl + C: Terminate command

Ctrl + z: Suspend command

  Iii. re-executing the order

Ctrl + r: Reverse Search Command History

Ctrl + G: Exit from historical search mode

Ctrl + P: previous command in history

Ctrl + N: The next command in history

Alt +.: Use the last argument of the previous command

 Four, Bang (!) command

!! : Execute Previous command

!blah: Executes the most recent command that begins with blah, such as!ls

!blah:p: Print output only, not execute

!$: Last parameter of previous command, with Alt +. Same

!$:p: Contents of!$ printout

!*: All parameters of previous command

!*:p: Contents of!* printout

^blah: Deletes the blah from the previous command

^blah^foo: Replace the blah in the previous command with Foo

^blah^foo^: Replaces all blah in the previous command with Foo

Summarize:

Most of the bash shortcuts described above are valid only in Emacs editing mode, and if you configure Bash as VI edit mode, it will follow the key binding of VI.

Bash defaults to emacs edit mode. If your Bash is not in Emacs edit mode, you can set it by Set-o Emacs.

^s, ^q, ^c, ^z are processed by terminal equipment and can be set by Stty commands.

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.