linux 命令:alias 详解

名称

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

用法

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

描述

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

选项

        -p        展示所有别名。

使用示例:

1. 展示别名:

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

 2. 定义别名:

[root@server dir]# alias la='ls -a'
[root@server dir]# alias la
alias la='ls -a'
[root@server dir]# la
.  ..  a  b  c  dir1  dir2  dir3  dir4  file2  file3  file4  File4  file5  filee  file.zip  .temp
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值