失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > linux 命令:alias 详解

linux 命令:alias 详解

时间:2018-10-16 07:47:38

相关推荐

linux 命令:alias 详解

名称

alias - 定义或展示命令别名。

用法

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

描述

不指定参数时,展示别名列表,格式为 'alias NAME=VALUE'。否则,定义别名,其中NAME 为 VALUE的别名。扩展别名时,值中的尾随空格会导致检查下一个单词是否存在别名替换。

选项

-p 展示所有别名。

使用示例:

1. 展示别名:

## 展示所有别名[root@server ~]# aliasalias 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@server ~]# alias llalias ll='ls -l --color=auto'

2. 定义别名:

[root@server dir]# alias la='ls -a'[root@server dir]# alias laalias la='ls -a'[root@server dir]# la. .. a b c dir1 dir2 dir3 dir4 file2 file3 file4 File4 file5 filee file.zip .temp

如果觉得《linux 命令:alias 详解》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。