The best keyboard shortcuts for Bash (aka the Linux and macOS Terminal)

ritazhaang

Did you know using the command line doesn’t have to be a slow, tedious experience? Whether using Linux, macOS, or even Windows with a Linux-based environment, Bash is the go-to shell for powerful command-line control. And the best part? You don’t have to type everything manually—Bash comes with handy keyboard shortcuts that make navigating and managing commands a breeze! You should try out these keyboard shortcuts and see how much faster and smarter you can work!

Storysert/ Freepik / “Typing-concept-illustration” / FreePik license

Managing processes like a pro

When you’re working in the Terminal, managing processes is a key skill for improving your productivity. In this tutorial, you’ll learn how to control processes efficiently using a few basic shortcuts.

Run a process

  • First, open Terminal mode and type in the following command: ping google.com
  • This command starts sending continuous requests to Google’s server to check connectivity. It will keep running until you tell it to stop.

Stop the process immediately (Ctrl + C)

  • If you want to stop the process immediately, press: Ctrl + C
  • This sends a signal to terminate the running process. Try it now and see if the ping stops.

Suspend the process (Ctrl + Z)

  • If you want to pause the process rather than stop it completely, press: Ctrl + Z
  • This suspends the process, placing it in the background. To bring it back, type: fg
  • Press Enter. The process will resume running where it left off.

Exit Bash (Ctrl + D)

  • Finally, to exit the Terminal, you can either type exit. or press Ctrl + D
  • This will close your Bash session. It’s faster than typing “exit” and is especially useful when you’re ready to leave the Terminal.

Mastering these simple shortcuts can help you manage processes like a pro in Bash. Now, you have control over your running tasks and can navigate your Terminal sessions more efficiently!

Controlling the Terminal display

Ever had too much text flood your screen, making it hard to focus? Maybe you ran a long command that spewed out endless lines, or you just wanted a clean slate without reopening the Terminal. These shortcuts will save the day:

  • Ctrl + L: Clears your screen—try it now!
  • Ctrl + S: Freezes output (handy when things scroll too fast).
  • Ctrl + Q: Unfreeze output. Try pausing and resuming now!

Quick cursor navigation

Tired of slowly navigating through your command line? These shortcuts will make editing a breeze and help you type faster than ever:

  • Ctrl + A or Home: Jumps to the start of the line.
  • Ctrl + E or End: Moves to the end.
  • Alt + B: Jumps back one word—test it out!
  • Alt + F: Moves forward one word. Neat, right?

Delete text in a flash

Mess up while typing? Fix it fast!

  • Ctrl + D or Delete: Removes the character under the cursor.
  • Alt + D: Deletes everything after the cursor.
  • Ctrl + H or Backspace: Erases the character before the cursor.

Fix typos instantly

We’ve all been there—you’re typing a long command, and suddenly, you realize you’ve made a typo. Instead of hitting backspace a million times or starting over, use these quick fixes:

  • Alt + T: Swaps the current and previous words.
  • Ctrl + T: Fixes two mixed-up letters.
  • Ctrl + _: Undo the last action—yes, Bash has an Undo!

Cutting, pasting and capitalizing

Think you can only copy and paste with a mouse? Think again! Bash has built-in clipboard shortcuts that let you cut, copy, and paste right from your keyboard—just like in a text editor!

  • Ctrl + W: Cuts the word before the cursor.
  • Ctrl + K: Cuts everything after the cursor.
  • Ctrl + Y: Pastes (“yank” in Bash terms).
  • Alt + U: Capitalizes the rest of the word—watch it change!

Turbocharge with tab completion

Try typing cd /usr/loc and press Tab—Bash will autocomplete it!

You might need to visit Navigating Command History when you want to quickly recall, edit, or rerun past commands instead of retyping them from scratch. This is especially useful if you frequently use long or complex commands, need to troubleshoot errors, or want to increase efficiency in the Terminal. Command History shortcuts allow users to move through previous inputs, search for specific commands, and make modifications on the fly, saving both time and effort. 

Quickly recall and reuse previous commands:

  • Ctrl + P or Up Arrow: Scroll through past commands.
  • Ctrl + N or Down Arrow: Moves forward in history.
  • Ctrl + R: Searches history interactively—try typing cd after pressing it!

Emacs versus Vi mode

Prefer Vi over Emacs-style shortcuts? Switch modes easily:

  • Set Vi mode: Type set -o vi
  • Back to Emacs: Type set -o emacs

Conclusion

Congratulations on mastering these essential Bash keyboard shortcuts! By learning how to manage processes, navigate your Terminal with ease, fix typos instantly, and use advanced features like Autocompletion and Command History, you’ve taken a huge step toward becoming a true Bash pro. These shortcuts will help you work smarter and faster, giving you more control over your Terminal sessions and boosting your productivity. 

With these skills under your belt, you’re now ready to tackle even more advanced command-line tasks with confidence. Keep practicing, and soon enough, navigating Bash will feel like second nature. Well done on your journey to mastering the Terminal—you’re officially a Bash pro!

All rights reserved ©2016 - 2026 Achievable, Inc.

Discover more from Achievable Test Prep

Subscribe now to keep reading and get access to the full archive.

Continue reading