Useful Command Line Shortcuts

I'm The Flying Dev - flight attendant and self-taught developer. The founder and host of the Landing in Tech podcast.
Search for a command to run...

I'm The Flying Dev - flight attendant and self-taught developer. The founder and host of the Landing in Tech podcast.
No comments yet. Be the first to comment.
If you use an email long enough, you know how much spam that email will get - some even pass through the filter and reach your inbox. When this happens, you can do three things: Add filtering to delete emails from a specific domain/email address aut...

Actions I've taken to improve security and accounts hardening

When I built the website for Landing in Tech I wanted to have a bar on top of the page with the latest episode. The idea was to allow users to listen to the episode while browsing the page. I added the iframe on my layout.js file and expected it to ...

Version control systems are tools to keep track of changes to source code or other collections of files and folders. They help to track the changes of documents, they make it easy collaborating with someone else. Version Control track changes in a se...

As developers, we use the terminal all the time, it makes sense to learn some shortcuts that can help you do things in the command line.
Learning these will also help you boost your productivity because you don't have to retype your commands again just because you found a mistake.
I've also created a short(ish) video that shows some of the shortcuts mentioned in this article.
Note: When I recorded this video, I thought the shortcut
CTRL+Uwas deleting the line, but it's just cutting the whole line, you can paste the text withCTRL+Y.
Let's be honest how many times do we write a command, just to notice that around the beginning of the line there is a mistake and we delete everything and type the command again? These shortcuts will help you move the cursor easier without the need to delete the whole thing.
CTRL + A - Moves the cursor to the beginning of the lineCTRL + E - Moves the cursor to the end of the lineCTRL + arrow keys - Moves the cursor from word to word ALT + B - Moves the cursor back from word to wordALT + F - Moves cursors forward from word to wordCTRL + W - Cut the word left of the cursorCTRL + K - Cut the entire text at the right of the cursorALT + W - Cut the entire text at the left of the cursorCTRL + U - Cut the entire lineCTRL + Y - Paste the previous cut textCTRL + T - Swap two letters between the cursorthis if the cursor is between the h and i it turns into tihsESC + T - Swap two words between the cursorthis text will become text thisESC + U - Uppercases text right of the cursor - moves cursor to the end of wordCTRL + Q - Deletes text from line - clears line onlyCTRL + L - Clears the terminal -> No need to write clear all the time!CTRL + R - Reverse search your history for a termCTRL + R again to cycle through results!! Repeat the last command used in the terminalsudo !! to repeat the last command with sudoI've created a cheatsheet with these commands, hopefully, this will help you get used to using the commands.

