Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Bash has three useful kinds of shortcuts: Readline key bindings edit the command you are typing, history features bring back commands or their arguments, and aliases give recurring commands shorter names. In the default Emacs editing mode, a few Readline keys can move the cursor or change a long line without reaching for the arrow keys. History expansion can reuse earlier text, while aliases help with commands you type often.

“Save me hours” is a personal claim, not a measured result: no cited study establishes how much time Bash users save. The practical benefit is more modest and concrete—fewer keystrokes for tasks you repeat. Which bindings work depends on your editing mode, terminal, and configuration.

First, know which kind of shortcut you need

Bash uses GNU Readline to read and edit commands at the interactive prompt by default. The GNU Bash Reference Manual, Edition 5.3, updated May 18, 2025, states: “Bash uses Readline (see Command Line Editing) to read commands from the user’s terminal.” Readline bindings affect the line you are composing; they are not the same thing as terminal-emulator shortcuts or shell commands. See the GNU documentation on command-line editing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Readline bindings: Move through or edit the current prompt line.
  • History: Recall an earlier command or insert part of it into the current line.
  • Aliases: Substitute a short command name for a longer command name and its defined text.

Bash supports Emacs and vi editing modes. The bindings below are for the usual Emacs mode; vi-mode users should use the mode-specific bindings instead. A user configuration can also change defaults. Check your active mode with set -o and look for emacs or vi in the output. The Bash manual’s interactive-shell section describes interactive behavior.

#1 Best Overall
Sale
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.

Move around a long command

In Emacs mode, these default Readline bindings move the cursor within the current command line. Ctrl means hold Control while pressing the letter. For Alt combinations, the terminal may send Meta differently: try pressing Alt and the key together, or press Esc and then the key.

Task Emacs-mode binding What it does
Go to the start or end of the line Ctrl+A / Ctrl+E Move to the beginning / end of the current command line.
Move by word Alt+B / Alt+F Move backward / forward by a word.
Move one character Ctrl+B / Ctrl+F Move left / right by one character.

For example, if you notice a typo near the beginning of a lengthy command, use Ctrl+A, then move forward with Alt+F or the character keys. Correct the text in place instead of holding an arrow key and hoping to stop at the right spot. Consult the Readline command-line editing reference if a key does something different in your setup.

Edit or clear the current line

These bindings change text on the prompt line; they do not execute the command. A “kill” in Readline means cut text into its kill ring, where it can be yanked back.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
Task Emacs-mode binding What it does
Delete from cursor to line start Ctrl+U Kill the text between the cursor and the beginning of the line.
Delete from cursor to line end Ctrl+K Kill the text between the cursor and the end of the line.
Delete the previous word Ctrl+W Kill the word immediately before the cursor.
Restore killed text Ctrl+Y Yank the most recently killed text into the line.
Transpose adjacent characters Ctrl+T Swap the character before the cursor with the character at the cursor.

Use Ctrl+U when you want to discard the part of a command before the cursor, or Ctrl+K to discard what follows. If you cut text by mistake, Ctrl+Y can restore it while you are still editing. These actions are line editing, not a guarantee that a command has been saved or run.

Search and recall command history

Interactive Bash keeps a command history by default. You can bring commands back for review and editing rather than retyping them. Ctrl+R starts a reverse incremental search: type part of an earlier command to find a match. Press Ctrl+R again to move to an older match. When the desired command appears, press the right arrow to place it on the prompt for editing, or press Enter to run it. Readline’s forward-search counterpart is Ctrl+S; some terminal configurations reserve that key for flow control, so it may not reach Readline as expected.

  • Ctrl+P and Ctrl+N move to the previous and next history entries, respectively.
  • The up and down arrows commonly navigate the same history entries.
  • Review a recalled command before running it, especially if it removes files, changes permissions, or affects remote systems.

History behavior and history expansion are configurable. The manual explains both in Interactive Shell Behavior and History Interaction.

Rank #3
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*

Reuse an earlier command or its arguments

Bash history expansion uses ! by default in interactive shells. It can repeat a prior command or insert its words into the line. The GNU manual describes the feature as making it easy to “repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly.” History expansion can be disabled or customized, and is not enabled by default in non-interactive shells.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Expression Typical use Effect
!! Repeat the most recent command. Expands to the previous history entry.
!^ Reuse the first argument of the previous command. Expands to that entry’s first argument.
!$ Reuse the last argument of the previous command. Expands to that entry’s final argument.
!* Reuse all arguments of the previous command. Expands to the previous entry’s arguments; omit the space after the expression.

For instance, after mkdir project, typing cd !$ uses the previous command’s last argument, so the resulting command is cd project. History expansion happens before the command runs, but do not rely on memory for a destructive command: inspect the expanded command first. In many interactive setups, !$ followed by Esc then Ctrl+E expands it on the line for inspection; behavior can vary with Readline and shell configuration.

History expansion is separate from Readline’s search keys: Ctrl+R searches and recalls a whole command interactively, whereas !! and related expressions expand history text in the command line. The official details are in History Interaction.

Rank #4
Sale
Redragon K521 Upgrade Rainbow LED Gaming Keyboard, 104 Keys Wired Mechanical Feeling Keyboard with Multimedia Keys, One-Touch Backlit, Anti-Ghosting, Compatible with PC, Mac, PS4/5, Xbox
  • 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
  • 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
  • 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
  • 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
  • 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Create an alias for a recurring command

An alias is a user-defined substitution for a command name, not a keyboard binding. Interactive Bash expands aliases by default. For example, this creates a short name for a frequently used directory listing:

alias ll='ls -alF'

After entering it, type ll at that interactive prompt. The alias exists only in that shell session unless you add its definition to a startup file appropriate to how you launch Bash. Startup-file selection differs for interactive and login shells; consult the manual rather than assuming every Bash session reads the same file. The Bash builtins reference documents the alias and bind builtins.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Aliases are most useful for simple, stable command-name substitutions. They are not general-purpose functions with argument handling. If a recurring task needs parameters or conditional logic, a shell function or script may be a better fit.

Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later

Check what your shell actually does

When a shortcut fails, first determine whether the issue is the editing mode, a changed binding, or the terminal’s handling of a key.

  1. Check the mode: run set -o and see whether emacs or vi is enabled. In Emacs mode, set -o emacs selects Emacs-style line editing; set -o vi selects vi-style editing for the current shell.
  2. Inspect bindings: run bind -P to print Readline function bindings, or bind -p to print them in a form suitable for reuse. Search the output for a function name such as beginning-of-line or reverse-search-history.
  3. Test Meta handling: for an Alt binding, try Esc followed by the key. Terminal emulators and local configuration can affect how Meta/Alt reaches Readline.
  4. Check the context: Readline shortcuts apply at an interactive Bash prompt; they do not generally edit a command already running in another program, and non-interactive scripts do not use interactive history expansion by default.

The bind builtin can also assign Readline bindings, but changing a binding is a user configuration choice rather than a universal default. The official Bash Builtin Commands reference lists its inspection and configuration options.

Build a small shortcut habit

A useful way to learn is to choose one repeated friction point rather than memorize a full map at once. Start with line navigation if you often correct long commands, history search if you repeat commands, or an alias if you type the same command name and options over and over. A community-posted Bash keyboard-shortcuts map is one example of a visual reference covering cursor movement, history search, and editing commands; it is not official documentation, so verify behavior against your own mode and bindings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A 2020 study by Michael Schröder and Jürgen Cito analyzed more than 2.2 million shell alias definitions mined from public GitHub configurations. Its reported median alias compression ratio was 4.25, meaning half of the analyzed alias values were at least four times as long as their alias names. That describes those observed aliases—not time saved, keystrokes saved by every user, or the experience of all shell users. The study is An Empirical Investigation of Command-Line Customization.

Quick Recap

SaleBestseller No. 1
SaleBestseller No. 3
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.39
SaleBestseller No. 5
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.