Since the Linux operating system is based almost entirely on terminal commands, it is imperative that you create some basic aliases to make your life a bit easier. One way of doing this is to just issue the command, “alias=command.” The problem with this method is that it only keeps the alias until the system is logged off, then you have to enter it all over again.
The solution? Enter the alias in the .bashrc file. This simple tutorial will explain to you how to do this.
Log into Linux and open a terminal.
Place your select cursor at the end of the last #alias example and hit enter, making a new line. See photo below.
Type the alias in the specified above location using the following format:
Replace [shortcut] with the alias you want, and replace [command] with the command that the alias stands for.
Example: alias updatesys='apt-get update && apt-get upgrade'
The above example is a alias that I use so I can easily update Kali without having to type in “apt-get update && apt-get upgrade” every time.
You’re almost there! Now that you’re done typing the alias in, you need to save the .bashrc file. Do this quickly by hitting Ctrl+S or click “File > Save.”
To insure that the file has been completely saved, make sure that the asterisk next to the file name is gone:
Now close the .bashrc file and the terminal behind it. Open a new terminal and try out your alias. If all went according to plan, the alias will be permanent, and can only be removed if you remove it from the .bashrc file in the same way you created it.
Congrats! You’re done!
Repeat these steps to create as many permanent aliases as you please!