Aliases when using Linux command lineÂ can shorten commands so that there is no need to type them in full.
They can be viewed using the following command :
Adding them is simple, for example : to add an alias for the command uptime as u :
What this will do is show the system uptime just by typing in ‘u’. However, this change is only for the current session. It won’t be present after a logout or reboot.
So to make itÂ permanent, .bashrc needs to be edited. This is the file which stores the Bash shell configuration. So, first backup this file :
[~ is the same asÂ /home/username/ but saves time when typing ]. For more information on Linux command line, check out the tutorial series here.
Then it can be edited using a text editor (nano in this example) :
Scroll to the aliases section and add the alias entry over there.
Once added, save the file. The changes will not be in effect though because the old .bashrc file is still in use.
So make the Bash shell use new one :
Then try the added alias, it will now be active :
Similarly, various different aliases can be added. So, for example instead of typing sudo apt-get update everytime, use an alias like upd.
Other frequently used command like those for installing packages and more can be aliased too as needed.