Tutorials

How to use linux alias

Table of contents:

Anonim

What is this of the Alias ​​in Linux and how is it used? If you have Linux and want to customize it, you will like this, because there is a way to customize commands so that they are easier to use through an alias. This alias will allow us to replace one word or series of words with another. The idea is that it is simpler and easier for us to remember and that it also allows us to invoke a command.

Do you want to know how this is done? We are going to tell how to use the alias in Linux.

How to use the alias in Linux

If you want to know how the alias is used in Linux and create your own commands, we are going to tell you everything you need to know.

Create an alias in Linux

Remember that the command you are going to replace must be in single quotes (not double!), Otherwise it will not work for you and the result will be negative because it will have done absolutely nothing.

The downside of this method is that it is temporary. That is, it lasts until you close the command console. So it will not hold you long if what you want is to use that alias forever. If you want the alias to be permanent, you will have to put it inside the file ~ /.bashrc (you will find it in the / home directory). If you can't find it you can create it, but remember to put the point in front. After adding the alias line to this file, simply type $ in the console . .bashrc.

And you're done! With these tricks, you will be able to use the alias in Linux whenever you want, both temporarily and forever. It is very comfortable especially if you use long and complicated commands that you do not remember or want to write as much text.

Another trick is that if you go up with the date above, you will find all the commands you have used. It's also fast and you won't have to create aliases if you don't want to.

Tutorials

Editor's choice

Back to top button