Using the alias command
alias shows the current shell process all the available command aliases
Define an alias NAME, equivalent to execute the command VALUE, alias defined in the command line is only valid in the current shell, the newly opened shell can not be used.
alias NAME='VALUE'
[root@XX ~]# which who /usr/bin/who [root@XX ~]# whereis who who: /usr/bin/who /usr/share/man/man1/who.1.gz /usr/share/man/man1p/who.1p.gz [root@XX ~]# which ls alias ls='ls --color=auto' /usr/bin/ls
If you want permanent, to be defined in the configuration file
Valid for the current user: ~ / .bashrc home directory .bashrc hidden files
Effective for all users: / etc / bashrc
The new configuration will not edit the configuration file is given immediately after the effective implementation of effective demand
Use the command source / path / to / config or. / Path / to / config
Use the command unalias
unalias NAME canceled temporary alias NAME
unalias -a Cancel all temporary alias NAME
If the alias command of the same name on the original, if you want to execute the original command, you can use the following method
\cmd
"cmd"
' cmd'
command cmd
/path/command