Command alias: Alias
Alias displays all aliases defined in the current shell
[Root@zabbix_agentd zabbix]# Alias
Alias cp= ' Cp-i '
Alias egrep= ' Egrep--color=auto '
Alias fgrep= ' Fgrep--color=auto '
Alias grep= ' grep--color=auto '
Alias l.= ' ls-d. *--color=auto '
Alias ll= ' Ls-l--color=auto '
Alias ls= ' ls--color=auto '
Alias mv= ' Mv-i '
Alias rm= ' Rm-i '
Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '
[Root@zabbix_agentd zabbix]#
The alias for the command is defined in the alias, as shown above, when the CP is used, the cp-i is actually used, and if the alias is not applicable, the backslash \CP can be added before the command
Define Alias
Alias alias = "Original Command" in the original command always, if there is no argument you do not need to add a space '
As follows:
Define screen command clear alias as CLS
[Root@zabbix_agentd zabbix]# alias Cls=clear
Clear can be executed using the CLS after definition
[Root@zabbix_agentd zabbix]# Alias
Alias cls= ' Clear '
Alias cp= ' Cp-i '
Alias egrep= ' Egrep--color=auto '
Alias fgrep= ' Fgrep--color=auto '
Alias grep= ' grep--color=auto '
Alias l.= ' ls-d. *--color=auto '
Alias ll= ' Ls-l--color=auto '
Alias ls= ' ls--color=auto '
Alias mv= ' Mv-i '
Alias rm= ' Rm-i '
Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '
Release alias: Unalias
[Root@zabbix_agentd zabbix]# Unalias CLS
[Root@zabbix_agentd zabbix]# Alias
Alias cp= ' Cp-i '
Alias egrep= ' Egrep--color=auto '
Alias fgrep= ' Fgrep--color=auto '
Alias grep= ' grep--color=auto '
Alias l.= ' ls-d. *--color=auto '
Alias ll= ' Ls-l--color=auto '
Alias ls= ' ls--color=auto '
Alias mv= ' Mv-i '
Alias rm= ' Rm-i '
Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '
[Root@zabbix_agentd zabbix]#