The terminal is an integral part of the Linux experience and used to be even more important than it is now. Despite two decades of use, there are a few Linux terminal shortcuts that always impress me with how useful they can be. These are 5 Linux tricks that will make tedious and mundane jobs much easier.
&& is the best way to combine commands
Avoid typing multiple commands line by line
When I started using Linux, I almost always typed a command, waited for it to run, and then ran the next command if everything went well. That’s fine, but there’s a better way to approach the problem: use the && symbol.
Let’s say I have two commands I want to run, A and B, and I’ll only run the second command (B). Yeah A works correctly.
Normally you would just type both commands. Alternatively you could run:
sudo A && sudo B
That allows me to combine two commands on one line with the specific condition that B only run if A worked. The other symbol you can use to combine commands, the semicolon, doesn’t care whether the first command was executed correctly; will go ahead anyway.
It doesn’t come up every day, but I found that I use it quite often when writing simple scripts. It’s also great if I pass along instructions for someone to try and I want to make sure everything works correctly and in a specific order.
&& is not limited to just two commands; You can use it as many times as you want, although I recommend that you don’t create anything that is too long. After a while, it becomes difficult to read.
Don’t rewrite your last argument manually, use !! instead
!! It’s also more versatile than the up arrow.
You will often need to re-enter the command you just typed. Instead of rewriting it in its entirety, all you need to do is write !! to run it again.
You can also combine it with other commands. So if you ran a command that really needed sudo, but forgot it the first time, all you need to do is type sweat!!. If you want to output the command output to a file, you can run !! > output.txt.
It’s a huge quality of life improvement, but sometimes I forget to use it.
Not all shells support it!!, but both Bash and Zsh do support it.
Suspend a job and resume it in the background
Ctrl+Z and the bg command
Most of the commands you will run in the terminal will be almost instantaneous, but every once in a while you will run a command that will take a while.
Instead of tying up your terminal until the task is completed, you can press Ctrl+Z temporarily suspend the task. Then run bg in terminal to resume background work.
If you have multiple tasks suspended in the background, you can run jobs to see the ID of each individual job and then use it to move a specific job to the background. For example, if I suspend two background jobs, I will run fund %2 to activate the second background job. If I wanted to bring it back to the foreground, I would run %2.
You can also type the name of the process, although numbers are usually faster and easier.
Create your own shortcuts
Alias of a command you use frequently
Typing the same command over and over, especially if it’s long, can quickly get tedious. That’s where alias Forward.
An alias allows you to assign a shorter name to a different command or change what you enter to execute a specific command.
For example, I often want to get a detailed view of the contents of a folder, but I don’t want to type ls -lah again and again. Instead, I can simply use the ll alias to execute that command. The command would be:
alias ll='ls -lah'
So every time I write allls -lah will actually be run instead.
Often ll already has the alias ls -l, but I prefer additional information in a human-readable format.
I created my own turnkey distro for hosting game servers and usually package a handful of aliases that make it easy to check the status of the firewall, systemctl, and a few other things. Aliases are designed to make your life easier, so don’t be afraid to experiment.
It’s tempting to use the rm alias so you don’t accidentally delete anything, but I highly recommend it. If you get used to rm having an alias for something with a message (or for a move command that works like a trash can), you will eventually make a critical mistake in a system that No have that alias. It’s best to use a standalone program, such as trash-cli.
CD: makes switching from one side to the other a breeze
Who needs two windows open?
If you spend any time working with a command line interface, you’ll find yourself typing cd a lot. My favorite overlooked cd command is:
cd -
cd: will automatically return you to the previous directory you were working in. So, for example, if I were at “/home/folder1/minecraft” and used cd to switch to “/etc/”, running cd would take me directly back to “/home/folder1/minecraft”. If I run it again, it will take me back to “/etc/”.
Every time you need to switch between two folders and you don’t have a terminal multiplexercd: it is a good way to save a lot of writing time.
Simple is the best option.
None of these tricks are particularly spectacular or strange, but they don’t have to be: they’re simple and they work. Whether you’re a beginner just learning how to use the terminal for the first time or a veteran user who missed them, it’s worth memorizing them – they’ll save you time in the long run.
- Brand
-
Free
- Operating system
-
Kubuntu 24.04LTS
- Case
-
4.6 inches
Like all Kubuntu Focus systems, the NX GEN 3 can save you time and hassle every day. It requires very little configuration, is self-explanatory, and works well in environments with little or no IT. It has validated updates for years after your purchase.





