DEV Community 👩‍💻👨‍💻

Cover image for Linux Terminal Keyboard Shortcuts (a cheatsheet)
Mia
Mia

Posted on

Linux Terminal Keyboard Shortcuts (a cheatsheet)

As soon as I finished my previous article about the Basic Linux Terminal Commands, I knew that I wasn't done talking about the Linux terminal. Actually I'm just getting started, so let's dive in.

When I first started my journey as a developer, using the terminal was quite a hassle left alone the fact that I didn't understand half of the commands that I was typing in, I just didn't know how to use it properly.

For instance, I would mistype a letter which is not a big deal. But then, in order to correct my command I would have to keep pressing the left arrow to go all the way back to the mistake I've made. If the command was long enough, that process could take up to 10 seconds and those were the longest and most irritating 10 seconds of my life.

The solution to this problem was actually simple and it was always there under my fingers : the keyboard shortcuts.

So if you're facing the same struggles that I had before, here's a (non-exhaustive) list that might help :

  • Navigation

Ctrl + a - Move the cursor to the beginning of the line.
Ctrl + e - Move the cursor to the end of the line.
Alt + f - Move the cursor forward one word.
Alt + b - Move the cursor backward one word.
Ctrl + f - Move the cursor forward one character.
Ctrl + b - Move the cursor backward one character.

  • Control

Ctrl + l - Clear the screen.
Ctrl + s - Pause terminal output.
Ctrl + q - Resume output into normal state after stopping it with Ctrl + s.

  • Edit

Ctrl + _ - Undo whatever you just did.
Ctrl + u - Cut everything from the current cursor position to the beginning of the line.
Ctrl + k - Cut everything from the current cursor position to the end of the line.
Ctrl + w - Cut the word before the current cursor position.
Ctrl + d - Cut the word after the current cursor position.
Ctrl + y - Paste.

  • History

Ctrl + r - Search command history.
Ctrl + p - View previous command in the history.
Ctrl + n - View next command in the history.

  • Processes

Ctrl + c - Kill the currently running process.
Ctrl + d - Exit the current shell.



If there is a keyboard shortcut that you would like to add to this list, please comment it down below :)

A special thanks to
Phondanai
and Mazhar Zandsalimi
For contributing to this cheatsheet !

Cover photo : Photo by Yousef Espanioly on Unsplash

Top comments (7)

Collapse
 
phondanai profile image
Phondanai

Ctrl + r is one of the shortcut I want to share, it's very useful to find command history :)

Collapse
 
marveen profile image
Rodrigo Valenzuela

one of the best !

Collapse
 
miabarbir profile image
Mia

This is a good one :)

Collapse
 
miabarbir profile image
Mia

Thank you for sharing, i'll add those right away :)

Collapse
 
msamgan profile image
Mohammed Samgan Khan

nice

Collapse
 
miabarbir profile image
Mia

Thanks :)

Let's Get Wacky


Use any Linode offering to create something unique or silly in the DEV x Linode Hackathon 2022 and win the Wacky Wildcard category

Join the Hackathon <-