16. Bash Shell - Killing And Yanking
Contents
You can cut and paste text through the killing and yanking features provided by the bash shell.
Killing Text Forward
We can use Ctrl K to cut the text behind the cursor:
|
|
Killing Text Backward
We can use Ctrl U to cut the text before the cursor:
|
|
Killing Word Forward
We can use Alt D to cut the word on or after the cursor:
|
|
Killing Word Backward
We can use Ctrl W or Alt Backspace to cut the word before the cursor:
|
|
Or:
|
|
Yanking (Pull word or text back from the Kill Ring)
We can use Ctrl Y to pull the killed word or text back from the kill ring.
We use either of the kill commands to demonstrate:
|
|
We run the following command to pull killed word back:
|
|
References 8.4.4 Killing And Yanking
Author Dong Chen
LastMod Sun Feb 17 2019