Linux basic commands --- alias alias

alias

Alias without parameters or alias list -p option to print on standard output in the form "name = value" is. When providing parameters for each given value of an alias name is defined. Trailing spaces in value will lead to the next check whether to replace a word when expanding the alias alias. For each name in the argument list for which no value is provided, print name and value of the alias. Alias returns true, unless it is given the alias name is not defined for it.

Scope of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora.

 

1 , grammar

alias [-p]  [name[=value] ...] 

 

2 , the list of options

Options

Explanation

-p

With "key = val" way to list all aliases

 

3 , examples

Delete an alias has been defined

[root@localhost ~]# alias                         //查看已经定义别名,mytail已经不存在

alias cp='cp -i'

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'

 

     

      062151kfmh5hoohbbq9lzh.gif



Guess you like

Origin blog.51cto.com/9888479/2452755