To create an alias in CentOS first you need to open your .bashrc file in an editor and add an alias declaration. Each user has their own .bashrc file and the aliases in each of those files only apply to those users when logged into their own account so the aliases for the root user will be in here:
/root/.bashrc
But the aliases for a user named bob would be in here:
/home/bob/.bashrc (if that was the user bob’s home directory)
Ok lets look at the syntax.
A basic alias looks like this:
alias keyword=’target’
Where keyword is the word you will enter and target is the word, phrase or command that will actually be entered in the shell.’’’)
Lets say you are logged in as root and you commonly wish to access a remote server via ssh. Open the .bashrc file in /root in your favorite text editor (we will use vi).
Add a new entry in this format:
alias myserver=’ssh root@192.0.32.10‘
save the file and close your shell. Open a new shell to be able to use the new alias and type myserver and then enter (or return) and it will be just as if you had typed ssh root@192.0.32.10
Each alias goes on it’s own line in .bashrc and remember you won’t be able to use the alias until you open a new shell.
ORIGINAL ARTICLE:http://www.networkredux.com/answers/dev-and-distros/centos/how-do-i-create-an-alias-in-centos