# Keystrokes

Keystrokes: Keyboard Shortcuts at the Prompt, History Tricks: !!, !$ and Ctrl+R, Jumping Around: cd -, pushd and \*\*.

Updated: November 10, 2026

1. [Keyboard Shortcuts at the Prompt](https://www.ask-codey.com/lessons/bash-keyboard-shortcuts) (Apprentice): Ctrl+A and Ctrl+E jump to the start and end of the command line, Alt+B and Alt+F move a word at a time, Ctrl+W and Ctrl+U delete a word or the line, and Alt+. brings back the last command's last argument.
2. [History Tricks: !!, !$ and Ctrl+R](https://www.ask-codey.com/lessons/bash-history-tricks) (Journeyman): !! runs the last command again and !$ reuses its last argument, sudo !! repeats a command that needed sudo, Ctrl+R steps back through older matches, and four lines in ~/.bashrc keep a longer history that every terminal adds to.
3. [Jumping Around: cd -, pushd and \*\*](https://www.ask-codey.com/lessons/bash-jumping-around) (Journeyman): cd - switches between two folders, pushd and popd keep a stack of folders to come back to, \*\* reaches into every folder below once globstar is on, and CDPATH lets cd find a project's folders from anywhere.

Source: https://www.ask-codey.com/courses/bash-in-depth/topics/bash-keystrokes
