Tech

Two tricks that make using the Linux command line much easier


Two penguins are walking to the left

Darrell Gulin/Getty Images

One of the myths surrounding the Linux operating system is that you have to run all sorts of complicated commands to get anything done. While that may have been the case a while ago, it is no longer true.

You can live your entire life with Linux and never run a command. That’s how far the Linux desktop has come over the years.

Also: The First 5 Linux Commands Every New User Should Learn

However, for some users, the power that the Linux CLI (Command Line Interface) offers can be appealing. And, as someone who has used Linux for decades, I still return to the command line for certain things.

That’s because the CLI can be really powerful. For example, there are two features you should know about that make using the Linux command line easier: Tab completion and history. Let me explain each of these features.

How to use tab completion

What you need: The only thing you need for this is a running version of Linux. It doesn’t matter which distribution you use, as both of these features are available in all versions of the open source operating system.

Let’s say you know there’s a command you need to run but don’t remember its name. You know it starts with systembut that’s all you can remember.

When your terminal window opens, type system and press Tab on your keyboard. You will then see all the commands on your system that start with system.

Look through the list until you find the command you need.

Linux commands begin with sys.

Remembering the systemctl command is easier when using tab completion.

Screenshot by Jack Wallen/ZDNET

Even better, you don’t have to type the entire command. For example, the command you’re looking for is ctl system. You can type systemPress Tab and the rest of the command will be filled in automatically.

Also: Top 5 Linux Distributions for Power Users (or Anyone Who Wants a Challenge)

This little trick would work better if there weren’t so many commands starting with system (for it to work) ctl system You must enter all but the last two letters. For example, if you are using Samba (to share folders on your network), you can enter smbc and press Tab to get the whole smb control The command is completed for you.

How to use command history

1. Scroll through your command history

Remember the last command you typed? If it was a complicated command, you might not want to have to type it again. To avoid this, open a terminal window and press the up arrow on your keyboard. What you will see is the last command you ran. Press the up arrow again and you will see the previous command. Keep pressing the up arrow on your keyboard and you will see a saved history of the commands you have typed.

2. Run a command from your history

When you find the command you want to run, pause there and press Enter on your keyboard. The command will run as if you had just typed it. This trick is useful when you don’t want to type complicated commands or you can’t remember exactly what command you ran before.

Also: How to Use the Linux History Command – and What It Can Do for You

To this day, I still use both of these tricks with Linux, and they always make using the command line a little easier. Once you start using these handy helpers, you’ll be less intimidated by the Linux CLI.

news7g

News7g: Update the world's latest breaking news online of the day, breaking news, politics, society today, international mainstream news .Updated news 24/7: Entertainment, Sports...at the World everyday world. Hot news, images, video clips that are updated quickly and reliably

Related Articles

Back to top button