[[Email protected] ~]# AliasaliasCP='cp-i'aliasMV='mv-i'aliasRM='rm-i'[[Email protected]~]# [[email protected]~]# [[email protected]~]# [[email protected]~]# [[email protected]~]# AliasCPaliasCP='cp-i'[[Email protected]~]# alias cls='Clear'[[Email protected]~]# [[email protected]~]# alias Clsalias cls='Clear'[[Email protected]~]# Aliasalias CLS='Clear'aliasCP='cp-i'aliasMV='mv-i'aliasRM='rm-i'[[Email protected]~]# cls #清屏了这时增加临时别名, a reboot will not be. If you want to be effective for a long time, you need to add a bit in the config file if you add one to the. bashrc file, or in/etc/profile. The following method is added under the. bashrc file. [[Email protected]~]# clsbash:cls: Command not found ... [[Email protected]~]# [[email protected]~]# [[email protected]~]#VI. BASHRC [[email protected]~]#Cat. BASHRC #. bashrc# User specific aliases and FunctionsaliasRM='rm-i'aliasCP='cp-i'aliasMV='mv-i'aliasCP='cp-i'# Source Global Definitionsif[-F/ETC/BASHRC]; Then . /etc/BASHRCfiEcho "Hellow"alias CLS='Clear'[[Email protected]~]# [[email protected]~]# alias CLS has been added to the configuration file, why does the view appear not found, because the file is not loaded, loading the file in two ways, one is source. BASHRC the other is. . BASHRC-bash:alias:cls: Not found [[email protected]~]# source. BASHRC Hellow[[email Protected]~]# alias Clsalias cls='Clear'[[Email protected]~]# [[email protected]~]# Aliasalias CLS='Clear'aliasCP='cp-i'aliasEgrep='egrep--color=auto'aliasFgrep='Fgrep--color=auto'aliasgrep='grep--color=auto'alias L.='ls-d. *--color=auto'alias LL='ls-l--color=auto'aliasls='ls--color=auto'aliasMV='mv-i'aliasRM='rm-i'aliaswhich='alias |/usr/bin/which--tty-only--read-alias--SHOW-DOT--show-tilde'[[Email protected]~]# Unalias-a temporarily empty all aliases [[email protected]~]# alias [[email protected]~]# . . BASHRC once the system is loaded or restarted, all aliases exist again Hellow[[email protected]~]# Aliasalias CLS='Clear'aliasCP='cp-i'aliasMV='mv-i'aliasRM='rm-i'[[Email protected]~]# [[email protected]~]#Cat. BASHRC #. bashrc# User specific aliases and FunctionsaliasRM='rm-i'aliasCP='cp-i'aliasMV='mv-i'aliasCP='cp-i'# Source Global Definitionsif[-F/ETC/BASHRC]; Then . /etc/BASHRCfiEcho "Hellow"alias CLS='Clear'[[Email protected]~]# unalias CLS #unalias CLS deletes the specified alias as cls= ' Clear '. [[Email protected]~]# alias CLS-bash:alias:cls: Not found [[email protected]~]#
Shell script, alias aliases command usage.