Linux

Bash Keyboard Shortcuts: Speed Up Your Linux Terminal Work

This guide covers essential Bash shell shortcuts to dramatically speed up navigation and editing in the Linux terminal.

Updated at February 15, 2026
5-10 min
Easy
FixPedia Team
Применимо к:Bash 4.0+Any Linux distribution

Introduction / Why This Matters

Knowing Bash keyboard shortcuts is like having a hotkey keyboard for a pilot. You'll be able to control the command line without taking your hands off the keyboard, cutting task completion time by 50% or more. This guide compiles the most useful and frequently used shortcuts that work by default in most Linux distributions. Once you master them, you'll no longer depend on the mouse and start working in the terminal at true speed.

Requirements / Preparation

To use these shortcuts, you'll need:

  • A terminal (GNOME Terminal, Konsole, xterm, Alacritty, etc.)
  • The Bash shell (usually installed by default on most distributions)
  • Basic understanding of command line operation

No additional configuration or package installation is required — all shortcuts work "out of the box".

Step 1: Navigating the Input Line

These shortcuts allow you to move the cursor within the current command or text you're typing.

ShortcutActionExample Usage
Ctrl + AMove cursor to the beginning of the lineYou type git commit -m "fix bug", press Ctrl+A — the cursor moves before git.
Ctrl + EMove cursor to the end of the lineAfter Ctrl+A the cursor is at the beginning, Ctrl+E returns it to the end.
Alt + B or Esc then BMove cursor back one word (toward the beginning)In the line cd /var/log/apache2, press Alt+B — the cursor jumps to /.
Alt + F or Esc then FMove cursor forward one word (toward the end)The opposite of Alt+B.
Ctrl + XXSwitch between the beginning of the line and the current cursor positionA quick way to jump back to the beginning and return without losing your place.

💡 Tip: On many keyboards, Alt may be labeled as Meta. If Alt+B doesn't work, try Esc (release it), then B. This is equivalent to Alt+<key>.

Step 2: Editing Text

These commands help you make quick edits without using the Backspace or Delete keys.

ShortcutAction
Ctrl + UDelete all text from the current cursor position to the beginning of the line.
Ctrl + KDelete all text from the current cursor position to the end of the line.
Ctrl + WDelete the word before the cursor (from the start of the word to the cursor).
Alt + D or Esc then DDelete the word after the cursor (from the cursor to the end of the word).
Ctrl + YPaste (yank) the last deleted text (like Ctrl+V in text editors).
Ctrl + TSwap the two characters before the cursor (e.g., if you typed sl, press Ctrl+T — it becomes ls).

Example: You typed git comit -m "message". Place the cursor after comit, press Alt+Dit is deleted. Then start typing mit or use autocompletion.

Step 3: Working with Command History

Bash saves the history of all entered commands. These shortcuts let you quickly find and repeat them.

ShortcutAction
Ctrl + RIncremental search through history. Start typing part of a command (e.g., git), and Bash will show recent matches. Press Ctrl+R again for the next match. Enter to execute, Esc or arrows to edit.
Ctrl + P or Previous command in history (like the up arrow).
Ctrl + N or Next command in history (like the down arrow).
Alt + . (period)Insert the last argument from the previous command. Useful for cd: cd /some/long/path, then ls Alt+.ls /some/long/path.
Ctrl + GExit search mode (Ctrl+R) without executing the command.

⚠️ Important: By default, Bash stores history in the file ~/.bash_history. The history size is controlled by the HISTSIZE variable.

Step 4: Managing Background Tasks

When you run a process (e.g., ping or top), these shortcuts let you control it without opening a new terminal.

ShortcutAction
Ctrl + CInterrupt the current process (send SIGINT signal).
Ctrl + ZStop the process (suspend it, SIGTSTP signal) and return to the shell. The process remains in memory.
fgBring a stopped process to the foreground.
bgRun a stopped process in the background.
jobsShow the list of stopped and background jobs in the current session.
Ctrl + DExit the shell (equivalent to the exit command). If the input line is empty, it closes the terminal.

Example: You ran a long command find / -name "*.log". Pressed Ctrl+Z → process stopped. Typed bg → process continues in the background, and you can keep working.

Step 5: Additional Useful Shortcuts

These combinations simplify everyday tasks.

ShortcutAction
TabAutocompletion of filenames, commands, paths. Press once to complete, twice to show all options.
Ctrl + LClear the terminal screen (like the clear command).
Ctrl + ISame as Tab (rarely used).
Ctrl + HDelete one character before the cursor (like Backspace).
Ctrl + SStop screen output (XOFF). Useful when ls outputs too much.
Ctrl + QResume screen output (XON) after Ctrl+S.

💡 Tip: The Ctrl+S combination can make the terminal seem "frozen". If the screen stops responding to input, try Ctrl+Q to unlock it.

Check Your Results

You've mastered these shortcuts if you can:

  1. Quickly navigate long commands using Ctrl+A/E, Alt+B/F.
  2. Delete whole words (Ctrl+W, Alt+D) and restore them (Ctrl+Y).
  3. Find past commands in history via Ctrl+R without full scrolling.
  4. Stop (Ctrl+Z) and resume (fg/bg) processes.
  5. Use Tab for autocompletion and Ctrl+L to clear the screen.

Practice: Open a terminal, type a complex command (e.g., with multiple paths) and try all shortcuts from steps 1-5. Play with history: run a few commands, then press Ctrl+R and start typing their first letter.

Potential Issues

1. Shortcuts don't work in my terminal

Most often the problem is in the terminal emulator's settings. For example, in GNOME Terminal, go to Edit → Keyboard Shortcuts and ensure the shortcuts aren't remapped. Also check if "Compatibility mode" (e.g., for Ctrl+Shift+C/V) is enabled.

2. Alt+B/Alt+F do nothing

On some systems, the Alt key is used to trigger menus. Try pressing Esc, releasing it, then B or F. This is equivalent to Alt+<key>. If that still doesn't work, check the shell variable $TERM (should be xterm-256color or similar).

3. Conflict with other programs (e.g., screen/tmux)

If you use tmux or screen, they may intercept some shortcuts (especially Ctrl+B in tmux). In that case, you need to use their prefix (e.g., Ctrl+B then [ for copy mode in tmux). Outside multiplexers, regular Bash shouldn't have issues.

4. History isn't saved between sessions

By default, Bash saves history only on clean exit (exit or Ctrl+D). If you close the terminal with the "X" button, history may be lost. To avoid this, add to ~/.bashrc:

# Save history after each command, not just on exit
shopt -s histappend
PROMPT_COMMAND='history -a'

After this, every command will be immediately written to ~/.bash_history.

F.A.Q.

Why do some keyboard shortcuts in Bash not work in my terminal?
Can I change the default keyboard shortcuts in Bash?
Do these shortcuts work in other shells, such as Zsh or Fish?
How can I quickly test if I've memorized the shortcuts?

Hints

Master navigation within the input line
Master text editing
Work with command history
Manage background jobs
Learn additional useful shortcuts
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community