On bash command-line, how to delete all letters before cursor?
On bash command-line, how to delete all letters before cursor? I know Ctrl-k deletes all afterward the cursor.
Ctrl-u - Cut everything before the cursor
Other Bash shortcuts,
- Ctrl-a Move cursor to beginning of line
- Ctrl-e Move cursor to end of line
- Ctrl-b Move cursor back one word
- Ctrl-f Move cursor forward one word
- Ctrl-w Cut the last word
- Ctrl-k Cut everything after the cursor
- Ctrl-y Paste the last thing to be cut
- Ctrl-_ Undo
Additional bash command-line shortcut cheat sheet: http://www.bigsmoke.us/readline/shortcuts
See the documentation here: http://www.gnu.org/software/bash/manual/bashref.html#Commands-For-Killing