How to add an alias to a command in terminal?

alias new_name='old command'

To create a permanent alias you have to edit the .bashrc file in your home directory.

More info here

More .bashrc files here


On the bash command line it is simply a case of typing:

alias my_command="Command to run"

For example to create a short command run a long listing you could do:

alias ll="ls -l"

The quotes are not required if you are not adding switches to the aliased command.


To make permanent changes you can put your aliases separetely in ~/.bash_aliases