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.