Shell script, alias aliases command usage.

Source: Internet
Author: User
Tags aliases egrep

[[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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.