GNU/Linux Shell Create Your Own Command Alias


Example

If you are tired of using long commands in bash you can create your own command alias.

The best way to do this is to modify (or create if it does not exist) a file called .bash_aliases in your home folder. The general syntax is:

alias command_alias='actual_command'

where actual_command is the command you are renaming and command_alias is the new name you have given it. For example

alias install='sudo apt-get -y install'

maps the new command alias install to the actual command sudo apt-get -y install. This means that when you use install in a terminal this is interpreted by bash as sudo apt-get -y install.