Readline keyboard shortcuts illustrated
  2014-04-15

Readline is a library used by many softwares to make their interactive command line interface more convenient to use.

In addition to provide a history of previously-entered commands, many keyboard shortcuts are available to ease motion (go to the start of line, to the end, move to next word, …).

Bash is by far the most known software using readline. Ever used Ctrl+r to search through history of commands? this is readline. Ctrl+l to clear the terminal? Readline too.

Many readline cheatsheets already exist with an exhaustive list of keyboard shortcuts available, but I’m not going to create a similar version.

Readline shortcuts extract

Extract of the cheatsheet

My version has the following specificities:

  • Not dealing with every existing keyboard shortcut, but only 12 of them, related to motions and copy/paste. I’m pretty confident that mastering them will already improve your daily work. (Pareto principle)
  • For each shortcut, a little illustration to get the idea, and hopefully to ease their memorization. I also tried to add a little mnemonic sentence (English is not my native language, so suggestions are welcome

For the sake of completness, the official readline documentation describes all available keyboard shortcuts. (this is where I learned about the ‘undo’ Ctrl+_ keyboard shortcut)

These shortcuts can also be used with the lftp, python, gnupg, sqlite, bc, lvm2, … interactive prompts. Readline defines these keyboard shortcuts as the default emacs keybindings mode. A vi mode also exists

(Depending of your Firefox version, the embedded pdf reader may not render the files correctly.)