In a previous article, Daniel covered Basics of the command line. Here's a few extra tips on shell editing keystrokes I use often that might be useful.
C-texchanges the character at the cursor with the one before the cursor. This is handy for fixing typos.M-t(orESC t) is similar, but works on words instead of characters.M-.(orESC .) inserts the last word of the preceding command line. This is handy when you, say, first look at a file withlessand then want to remove it, you can typer m ESC .for the second command.
There's a lot more. See the bash manual page for details, search for "Readline key bindings".
Add a comment