bash: Readline Killing Commands

1 
1 8.2.3 Readline Killing Commands
1 -------------------------------
1 
1 "Killing" text means to delete the text from the line, but to save it
1 away for later use, usually by "yanking" (re-inserting) it back into the
1 line.  ('Cut' and 'paste' are more recent jargon for 'kill' and 'yank'.)
1 
1    If the description for a command says that it 'kills' text, then you
1 can be sure that you can get the text back in a different (or the same)
1 place later.
1 
1    When you use a kill command, the text is saved in a "kill-ring".  Any
1 number of consecutive kills save all of the killed text together, so
1 that when you yank it back, you get it all.  The kill ring is not line
1 specific; the text that you killed on a previously typed line is
1 available to be yanked back later, when you are typing another line.
1 
1    Here is the list of commands for killing text.
1 
1 'C-k'
1      Kill the text from the current cursor position to the end of the
1      line.
1 
1 'M-d'
1      Kill from the cursor to the end of the current word, or, if between
1      words, to the end of the next word.  Word boundaries are the same
1      as those used by 'M-f'.
1 
1 'M-<DEL>'
1      Kill from the cursor the start of the current word, or, if between
1      words, to the start of the previous word.  Word boundaries are the
1      same as those used by 'M-b'.
1 
1 'C-w'
1      Kill from the cursor to the previous whitespace.  This is different
1      than 'M-<DEL>' because the word boundaries differ.
1 
1    Here is how to "yank" the text back into the line.  Yanking means to
1 copy the most-recently-killed text from the kill buffer.
1 
1 'C-y'
1      Yank the most recently killed text back into the buffer at the
1      cursor.
1 
1 'M-y'
1      Rotate the kill-ring, and yank the new top.  You can only do this
1      if the prior command is 'C-y' or 'M-y'.
1