Common bash shortcut keys

Source: Internet
Author: User
ArticleDirectory
    • Edit command

Original article address:

I would like to share with you some of the shortcut keys that are usually useful in terminal operations,

Edit command
    • CTRL + A: Move to the beginning of the command line
    • CTRL + E: Move to the end of the command line
    • CTRL + F: forward by character (right)
    • CTRL + B: Move backward by character (left)
    • Alt + F: forward by word (right)
    • Alt + B: Move backward by word (left)
    • CTRL + XX: move between the beginning of the command line and the cursor
    • CTRL + u: delete from the cursor to the beginning of the command line
    • CTRL + K: delete from cursor to end of command line
    • CTRL + W: delete from cursor to beginning
    • Alt + D: delete from cursor to end
    • CTRL + D: Delete the character at the cursor
    • CTRL + H: Delete the character before the cursor
    • CTRL + Y: paste it to the cursor
    • Alt + C: Change the uppercase words from the cursor
    • Alt + u: changed from cursor to all uppercase words
    • Alt + L: changed from cursor to all lowercase words
    • CTRL + T: swap between the cursor and the previous character
    • Alt + T: exchange the cursor and previous words
    • Alt + backspace: With Ctrl + WSameSimilarly, there are some differences between separators [thanks to rezilla for correcting]

 

 

Run the command again.
    • CTRL + R: History of reverse search commands
    • CTRL + G: Exit from the historical search mode
    • CTRL + P: Previous command in history
    • CTRL + N: The next command in history
    • Alt +.: Use the last parameter of the previous command.
Control Command
    • CTRL + L: clear screen
    • CTRL + O: Execute the current command and select the previous command
    • CTRL + S: block screen output
    • CTRL + Q: allow screen output
    • CTRL + C: terminate command
    • CTRL + Z: suspend command
Bang (!) Command
    • !! : Execute the previous command
    • ! Blah: Execute the latest commands starting with blah, such! Ls
    • ! Blah: P: only print the output, not execute
    • ! $: The last parameter of the previous command, which is the same as ALT +.
    • ! $: P: print the output! $ Content
    • ! *: All parameters of the previous command
    • ! *: P: print the output! * Content
    • ^ Blah: Delete the blah in the previous command.
    • ^ Blah ^ FOO: replace blah in the previous command with foo
    • ^ Blah ^ Foo ^: replace all the blags in the previous command with Foo.

End

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.