How to edit commands on a terminal

Source: Internet
Author: User

When entering various commands on the terminal, typo often occurs. In the past, my only method was to move the cursor forward or backward, but it was really inefficient. Later I found that the text can be edited directly on the terminal, just like in vim. Although it is not so powerful, it is enough. Below we will summarize the commonly used ones.
1. move the cursor to the front of the command: ctrl +
2. Move to the end: ctrl + e
3. Move a character to the right: ctrl + f (Er, this seems to be directly followed to save trouble)
4. One character to the left: ctrl + B (same as alias)
5. One word to the right: alt + f (my keyboard seems useless and may conflict with the shortcut key of the terminal configuration, which needs to be changed)
6. Left word: alt + B
7. Delete the character behind the cursor: ctrl + d
8. Swap the cursor between two characters: ctrl + t
9. Swap the cursor between the left and right words: alt + t
10. Copy a word: double-click the left mouse button.
11. paste a word: middle mouse button
12. Delete all text from the cursor to the end: ctrl + k
13. Delete all text from the cursor to the beginning: ctrl + u
14. Delete All characters from the cursor to the end of the word: alt + d (if the cursor is already at the end of the word, the next word will be deleted)
15. Delete All characters starting from the cursor to the word: alt + backspace (if the cursor is already at the beginning of the word, the previous word will be deleted)

16. paste the text you just deleted: ctrl + y

In fact, most of the above are available in linux Command introduction books. The reason why I sum up is not how clever I am, but to make myself better remember. I now find that what I understand can be written and understood more deeply. What I don't understand is that the writing process may suddenly become open-minded. Liu weipeng once said: writing is for better thinking. I thought it was.

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.