As much as people like to deny it, if you are making the switch to Linux, you will probably end up using the terminal at some point. There is simply no way around it. While modern Linux distributions let you do a lot from the UI, there will always be things that are faster, cleaner, or even only possible through the terminal.
You can definitely learn commands to stop fearing the terminal, but there are also a few tricks that can make your workflow inside the terminal much faster.
Jump between words quickly
Why I stopped using the arrow keys
Using a mouse in the terminal is obviously not practical because it breaks the flow completely (and m…
As much as people like to deny it, if you are making the switch to Linux, you will probably end up using the terminal at some point. There is simply no way around it. While modern Linux distributions let you do a lot from the UI, there will always be things that are faster, cleaner, or even only possible through the terminal.
You can definitely learn commands to stop fearing the terminal, but there are also a few tricks that can make your workflow inside the terminal much faster.
Jump between words quickly
Why I stopped using the arrow keys
Using a mouse in the terminal is obviously not practical because it breaks the flow completely (and most terminal emulators don’t have mouse support anyway.) And as ashamed as I am to admit it, I used to hold down the arrow key to move across each character whenever I needed to edit a command. It was painfully slow and frustrating, especially when working with long paths or chained commands.
Then I found out there is a much better way. You can jump between words in your command line using Ctrl + Left/Right Arrow (or Option + Left/Right Arrow on macOS). This instantly moves the cursor one word at a time, making it far easier to fix typos or tweak arguments in the middle of a long command. This comes in really handy when I copy a command from somewhere and need to change a file path or argument. Instead of slowly moving the cursor across the entire line, I can jump straight to that part and make the edit right away.
You can also use Ctrl + A and Ctrl + E to move to the beginning and end of the line instantly. Once you start using these, you will wonder how you ever managed without them because editing in the terminal suddenly feels smooth and efficient.
Reverse search your command history
Finding old commands instantly
You can cycle through all your previous commands using the Up arrow key, which is fine for quick repeats, but it quickly becomes annoying when you’re trying to find something you ran a while ago. I’ve spent more time than I’d like to admit pressing the Up key over and over just to locate one specific command.
That’s where reverse search comes in. Press Ctrl + R, then start typing any part of the command you remember. The terminal will instantly search through your history and show matches as you type.
For example, let’s say you have run this command:
sudo apt update && sudo apt upgrade
If you ran that earlier and need it again, just press Ctrl + R and type “apt” (or any other relevant keyword.) Bash will bring it up instantly. You can press Enter to execute it or Ctrl + E to edit it before running.
Once you start using it, you’ll never want to scroll through your history one command at a time again.
Pull the last argument automatically
Retyping directories gets repetitive fast
There are plenty of times when you run a command and then need to use one of its arguments again in the next command. Re-typing it every time gets old fast, especially when it’s something long like a file path or a folder name.
For example, if you just created a new directory like this:
And now you want to move into it, you might instinctively type the name again:
mkdir projects
But there’s a faster way. You can automatically pull the last argument from your previous command by typing !$. So instead of typing the full command again, just write:
cd !$
The !$ expands to the last argument from the last command; in this case, projects. This little shortcut is one of those things that seems minor at first, but once you get used to it, it feels like a huge quality-of-life improvement when working in the terminal.
Edit your current command in your editor
The struggle with long commands
Sometimes you’ll paste a long command into the terminal and realize you need to edit a small part of it, like a file path, a flag, or an environment variable. Using the arrow keys to move through the entire line can get tedious, especially if the command is long or full of nested quotes.
That’s where this shortcut makes life easier. You can open your current command in your default text editor by pressing **Ctrl + X **followed by Ctrl + E. This instantly launches the editor, letting you modify the command with proper navigation, syntax highlighting, and all the conveniences of a real editor.
This is especially useful when you copy a command from the internet and need to tweak a specific part of it. Instead of wrestling with the cursor, you can just open it in your editor, make the change, and close it to bring the edited command back into your terminal.
If it doesn’t open in your preferred editor, you can set one by exporting it first:
export EDITOR="nano"
Keep in mind, you can replace Nano with any other text editor of your choice, like Vim or Emacs.
Turn long commands into shortcuts with aliases
Saving time with your own shortcuts
This is not exactly a shortcut in the traditional sense, but it is such a huge time saver that it deserves a mention. In a way, it is a shortcut to getting things done faster without retyping the same long commands over and over.
If you often find yourself running the same repetitive commands, especially ones that are long or include multiple options, you can create an alias. An alias is basically a shorthand for a longer command that you define yourself.
For example, if you regularly update your system, instead of typing out something long every time, you could create an alias like this:
alias update='sudo apt update && sudo apt upgrade -y'
Now you only need to type update, and it’ll run the entire command automatically. You can add as many aliases as you like, and if you put them in your shell configuration file, they’ll persist every time you open a new terminal.
The learning curve is worth it
There are tons of awesome command-line tools you can use inside the terminal, but learning these shortcuts is something you should start with. If you are someone like me who prefers staying on the keyboard and keeping things minimal, working in the terminal just makes sense.
It takes some time to get used to, but once you do, it feels like second nature, and it is hard to go back to clicking around after that.