Computer

Use the Linux Terminal much faster thanks to the Alias ​​command

Although a few years ago most of the Linux distros they were considered suitable for the most advanced users, things have changed a lot. The main reason for this is that little by little this is a system that has become more affordable for most users. Much of the blame for all this lies with the graphical interface that we currently find in most distributions.

Thanks to this interface that we are talking about and that we find in current Linux versions, those that come from Windows will be able to function without problem. But of course, those who want to delve into the ins and outs of the open source operating system can continue to do so. One of the most interesting tools that we find for this is with the Terminal.

This allows us to get the most out of our own system, in large part thanks to the innumerable commands that we can use here. Of course, for this we will need to have a series of somewhat more advanced knowledge. But this is something the regulars already know Linux. At the same time, it is important to know those commands that can make things easier for us in the Terminal.

What is the Alias ​​command

A clear example of all this is found in the case that we want to talk about in these same lines. First of all, the first thing we should know is that we have several ways to open the Linux terminal. Perhaps the most comfortable method that we can use here, is through the key combination Ctrl + Shift + T. At that moment the corresponding window will open so that we can start working with the commands we need.

Well, at this point we will tell you that in Linux there is a command for the terminal called aliases. This, as we will see below, can be very useful in this operating system, largely thanks to the functionality that it proposes. At the same time it is possible that many users they don’t even know it exists, but they’ll probably be very happy to find out now. Moreover, it could be said that Alias ​​is valid for both the novice and the most expert in Linux, let’s see the reason for all this.

We tell you all this because the Alias ​​command allows us to replace one string with another when executing commands in the terminal. This can be very helpful when it comes to customizing this Linux terminal and adapting it to our needs. In short, the Alias ​​command actually allows us to make work in Terminal much easier once we get used to it. Thus, thanks to Alias, frequently used commands can be run using a different, custom term.

That is, those options u Linux commands that are complex or commonly used, can be called in a simpler way and adapted to what we prefer. Of course, it is important to know that everything that we define with Alias ​​is only valid for the current session on the PC. Therefore, they can be loaded at the time of login by modifying the file .rc from Terminal. Thus, by being able to redefine the commands we use the most, it will save us a lot of time and comfort. At the same time Alias ​​gives us the option of assigning large commands to an alias that we define and that will make things easier for us.

How to use the Alias ​​command

As you can imagine, the uses that we can make of this command here are the most varied. Starting from simple uses from basic actions that we repeat many times, even with complex commands that will save us a good amount of keyboard time. But of course, being able to take advantage of Alias ​​more or less will also depend on our knowledge of Linux, and our creativity when using it.

To give us a rough idea of ​​what we are talking about here, a very practical as well as simple example is the following:

alias softzone="rm -rf *"

aka softzone

Well, once we enter this command in the Linux terminalAfter pressing Enter we will see that nothing actually happens. And the fact is that the command as such does not return any output value, it just starts up. In order for us to understand this example that we have just shown you, we will explain what it actually does. Of course, we must be somewhat careful with the use of this specific example. The reason why this is practical but risky is that from now on if we enter any directory and type softzone, we delete everything in it.

In other words, thanks to the Alias ​​command, what we have done here is assign the term softzone the corresponding command to delete the files from a folder, respecting those of the system. As you can imagine, we can do the same for all those commands and orders that we need. As you can imagine, a correct use of this command Linux opens a huge range of possibilities in the system.

Alias ​​Preset Uses

Once we have become accustomed to its use, Aliases combined with complex or commonly used commands will help many of us to speed up our daily work in Linux. Of course, as we mentioned before, those Aliases that we define in one session, disappear in the next, that is, when restarting or turning off the Pc.

On the other hand, it is worth knowing that the system itself already brings some predefined Aliases that are always there for us. In order to get to know them first-hand, we recommend key just the command in the Terminal for these to appear on the screen.

predefined aliases

Related Articles