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-t exchanges the character at the cursor with the one before the cursor. This is handy for fixing typos.
  • M-t (or ESC t) is similar, but works on words instead of characters.
  • M-. (or ESC .) inserts the last word of the preceding command line. This is handy when you, say, first look at a file with less and then want to remove it, you can type r m ESC . for the second command.

There's a lot more. See the bash manual page for details, search for "Readline key bindings".