15. Bash Shell - Text Manipulation
Contents
We usually need to change the display of some text, and these changes can be made through the text changing command.
Delete char
We can use Ctrl + D to delete the character on the current cursor:
|
|

before manipulating

after manipulating
Backward delete char
We can use Backspace to delete the character before the current cursor:
|
|

before manipulating

after manipulating
Exchange chars
We can use Ctrl + T to swap the characters between the one the current cursor is on and the char before that char:
|
|

before manipulating

after manipulating
If we want to restore them, we have to move the cursor to the previous position and press the same command.
Exchange words
We can use Alt + T to swap the words between the one the current cursor is on and the the word before that word:

before manipulating

after manipulating
If we want to restore them, we have to move the cursor to the beginning of the word “Changing” and press the same command.
Uppercase word
We can use Alt + U to uppercase the word on or after the current cursor:
|
|

before manipulating

after manipulating
Lowercase word
We can use Alt + U to lowercase the word on or after the current cursor:
|
|

before manipulating

after manipulating
Capitalize word
We can use Alt + C to capitalize the word on or after the current cursor:
|
|

before manipulating

after manipulating
References 8.4.3 Commands For Changing Text
Author Dong Chen
LastMod Sat Feb 16 2019