Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INTERACTIVE EDITING COMMANDS IN BASH (STANDARD TERMINAL MODE)
- Readline Bare Essentials
- [...]
- CTRL-_ {NOTE: on a foreign keyboard layout---e.g. German---you may need to press three keys: CTRL-SHIFT-{DASH}}
- This will undo the last thing that you did. You can undo all the way back to an empty line.
- Readline Movement Commands
- CTRL-A
- Move to the start of the line.
- CTRL-E
- Move to the end of the line.
- META-F
- Move forward a word.
- META-B
- Move backward a word.
- CTRL-L
- Clear the screen, reprinting the current line at the top.
- Note how CTRL-F will move forward a _character_, while META-F will move forward a _word_. It is a loose convention that control keystrokes operate on characters while meta keystrokes operate on words.
- Readline Killing Commands
- "Killing" text means to delete the text from the line, but to save it away for later use, usually by yanking (re-inserting) it back into the line. When you use a kill command, the text is saved in a kill-ring; the text that you killed on a previously typed line is available to be yanked back later, when you are typing another line.
- Available commands:
- CTRL-K
- Kill the text from the current cursor position to the end of the line.
- META-D
- Kill from the cursor to the end of the current word, or if between words, to the end of the next word.
- META-DEL
- Kill from the cursor to the start of the current word, or if between words, to the start of the previous word.
- CTRL-W
- Kill from the cursor to the previous whitespace. This is different than META-DEL because the word boundaries
- differ.
- Yanking the text back into the line (i. e. restoring the most-recently-killed text from the kill buffer)
- CTRL-Y
- Yank the most recently killed text back into the buffer at the cursor.
- META-Y
- Rotate the kill-ring, and yank the new top. This is possible if and only if the prior command was CTRL-y or META-y.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement