> ## Content Index
> Fetch the complete content index at: https://www.binarysludge.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Mastering the Shell (and many other applications) aka Readline Shortcuts
- URL: https://www.binarysludge.com/2017/05/13/readline-shortcuts/
- Published: 2017-05-13T16:33:35.000Z
- Updated: 2017-05-13T16:33:35.000Z
- Author: Andrew Martin
- Tags: bash, linux, system adminstration, devops, #Import 2026-10-22 12:56

These should all be committed to muscle memory by now, but some continue to elude me:

|                                                                                                                                                            | Emacs keys                                                | Action                                                                        | Scope                                     | Direction/Place                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------- | ---------------------------------- |
| Moving around                                                                                                                                              | Ctrl-b                                                    | Move the cursor                                                               | one character                             | ⇦ to the left                      |
| Ctrl-f                                                                                                                                                     | Move the cursor                                           | one character                                                                 | ⇨ to the right                            |                                    |
| Alt-b                                                                                                                                                      | Move the cursor                                           | one word                                                                      | ⇦ to the left                             |                                    |
| Alt-f                                                                                                                                                      | Move the cursor                                           | one word                                                                      | ⇨ to the right                            |                                    |
| Ctrl-a                                                                                                                                                     | Move the cursor                                           |                                                                               | ⇤ to the start of the line                |                                    |
| Ctrl-e                                                                                                                                                     | Move the cursor                                           |                                                                               | ⇥ to the end of the line                  |                                    |
| Ctrl-x-x[\[1\]](http://blog.bigsmoke.us/2007/05/13/readline-exchange-point-and-mark-command?ref=binarysludge.com "Contributed by Lance Levine")            | Move the cursor                                           |                                                                               | ⇤⇥ to the start, and to the end again     |                                    |
| Cut, copyand paste                                                                                                                                         | Backspace                                                 | Delete                                                                        | the character                             | ⇦ to the left of the cursor        |
| DEL Ctrl-d                                                                                                                                                 | Delete                                                    | the character                                                                 | underneath the cursor                     |                                    |
| Ctrl-u                                                                                                                                                     | Delete                                                    | everything                                                                    | ⇤ from the cursor back to the line start  |                                    |
| Ctrl-k                                                                                                                                                     | Delete                                                    | everything                                                                    | ⇥ from the cursor to the end of the line  |                                    |
| Alt-d                                                                                                                                                      | Delete                                                    | word                                                                          | ⇨ untill before the next word boundary    |                                    |
| Ctrl-w                                                                                                                                                     | Delete                                                    | word                                                                          | ⇦ untill after the previous word boundary |                                    |
| Ctrl-y                                                                                                                                                     | Yank/Paste                                                | prev. killed text                                                             | at the cursor position                    |                                    |
| Alt-y                                                                                                                                                      | Yank/Paste                                                | prev. prev. killed text                                                       | at the cursor position                    |                                    |
| History                                                                                                                                                    | Ctrl-p                                                    | Move in history                                                               | one line                                  | ⇧ before this line                 |
| Ctrl-n                                                                                                                                                     | Move in history                                           | one line                                                                      | ⇩ after this line                         |                                    |
| Alt->                                                                                                                                                      | Move in history                                           | all the lines                                                                 | ⇩ to the line currently being entered     |                                    |
| Ctrl-r                                                                                                                                                     | Incrementally search the line history                     | ⇧ backwardly                                                                  |                                           |                                    |
| Ctrl-s[\[2\]](http://blog.bigsmoke.us/2013/08/05/readline-shortcuts-ctrl-s-and-xoff?ref=binarysludge.com "João Matos says: beware of freezing terminals!") | Incrementally search the line history                     | ⇩ forwardly                                                                   |                                           |                                    |
| Ctrl-J                                                                                                                                                     | End an incremental search                                 |                                                                               |                                           |                                    |
| Ctrl-G                                                                                                                                                     | Abort an incremental search and restore the original line |                                                                               |                                           |                                    |
| Alt-Ctrl-y                                                                                                                                                 | Yank/Paste                                                | arg. 1 of prev. cmnd                                                          | at the cursor position                    |                                    |
| Alt-. Alt-\_                                                                                                                                               | Yank/Paste                                                | last arg of prev. cmnd                                                        | at the cursor position                    |                                    |
| Undo                                                                                                                                                       | Ctrl-\_ Ctrl-x Ctrl-u                                     | Undo the last editing command; you can undo all the way back to an empty line |                                           |                                    |
| Alt-r                                                                                                                                                      | Undo all changes made to this line                        |                                                                               |                                           |                                    |
| Ctrl-l                                                                                                                                                     | Clear the screen, reprinting the current line at the top  |                                                                               |                                           |                                    |
| Ctrl-l                                                                                                                                                     | Clear the screen, reprinting the current line at the top  |                                                                               |                                           |                                    |
| Completion                                                                                                                                                 | TAB                                                       | Auto-complete a name                                                          |                                           |                                    |
| Alt-/[\[3\]](http://blog.bigsmoke.us/2007/05/09/bypassing-smart-completion-in-bash?ref=binarysludge.com "Contributed by Luca Citi")                        | Auto-complete a name (without smart completion)           |                                                                               |                                           |                                    |
| Alt-?                                                                                                                                                      | List the possible completions of the preceeding text      |                                                                               |                                           |                                    |
| Alt-\*                                                                                                                                                     | Insert all possible completions of the preceeding text    |                                                                               |                                           |                                    |
| Transpose                                                                                                                                                  | Ctrl-t                                                    | Transpose/drag                                                                | char. before the cursor                   | ↷ over the character at the cursor |
| Alt-t                                                                                                                                                      | Transpose/drag                                            | word before the cursor                                                        | ↷ over the word at/after the cursor       |                                    |

---

source: [http://www.bigsmoke.us/readline/shortcuts](http://www.bigsmoke.us/readline/shortcuts?ref=binarysludge.com)