Tutorial on aliases for the Linux terminal ("translate the commands")

tuxedo 007

An alias, according to the RAE, is a nickname or nickname. Well, as many of you know, there is a command in Linux called aliases with which you can put nicknames or nicknames as the dictionary says, to rename the commands. Almost all the tutorials and websites that I have seen that talk about aliases do so from a simplification point of view.

That is to say, use aliases to shorten names of certain commands and make them easier to write, something that is appreciated when you spend hours typing in the terminal due to your work. Also to better remember certain commands that you can give other names that you want. But here I would like to write an article from a different point of view, although with the same purpose as the rest, that is, to make life easier for us. But ... what if you "translate" the commands?

Let me explain, what I am trying to say is that if you are not a shell expert and you have to use commands frequently, You may be interested in calling them with their name in Spanish, since the computer world is based on English and all of them correspond to acronyms or Saxon words. But with aliases you could create nicknames in Spanish, which would make you remember them in a much easier and more intuitive way for you.

How does alias work? Well, alias allows us to rename or "alias" both commands and commands with their options. For example, imagine you want to rename "ls -l" which is a command we use a lot, as well as "df -h" so that you only have to type "l" in the first case and "r" in the second to execute the same action:

alias l=l='ls -l'

alias r='rm -i'

From now on, if you type l you would do an "ls -l" and if you type r you would do an "rm -i". But I continue with my idea, imagine that you use the terminal frequently and that you are not very good at English and you are not very expert in the shell either. If you have "commands in Spanish" it would make your life much easier. For that, we are going to put some examples of how to Spanishize the commands with aliases:

  • For example, to go out «Exit» therefore to be Spanish:
alias salir='exit'

  • To view the free space on the hard drive, instead of "df -h" which may be difficult for you to remember, and even more so if you don't use it frequently, let's make it Spanish:
alias espacio='df -h'

  • Imagine you have a Debian or derivative and you want to use a nicer alias to install your packages:
alias instalar='sudo apt-get install'

By the way, if you don't remember any aliases or do you want to see all aliases that you have already created, just put:

alias

And if you get tired and want to remove the aliases- Use the unalias command followed by the alias name you want to remove. For example, to remove the alias of exit, our "exit":

unalias salir

And you can continue with what you can think of more ... Castilianize the terminal! 


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.