Linux命令详解 -- alias
2015-07-30 10:04
686 查看
Alias with no arguments or with the -p option prints the list of aliases in the form alias name=value on standard output. When arguments
are supplied, an alias is defined for each name whose value is given. A trailing space in value causes the next word to be checked for
alias substitution when the alias is expanded. For each name in the argument list for which no value is supplied, the name and value of
the alias is printed. Alias returns true unless a name is given for which no alias has been defined.
Note aliases are not expanded by default in non-interactive shell, and it can be enabled by setting the expand_aliases shell option using
shopt.
alias 命令
作用: 设置命令别名,可以将较长的命令进行简化,使用alias 时,用户必须使用单引号将原来的命令引起来,防止特殊字符导致错误。
如要永久生效则将alias 命令存放到bash 的初始化文件 /etc/bashrc中。
语法:alias (选项)(参数)选项:-p: 打印已经设置的目录别名参数:命令别名 = 实际命令实例:alias 新命令= '原命令 -选项/ 参数'alias l ='ls -lsh'
删除别名: unalias 别名
查看系统设置的别名: 键入 alias
are supplied, an alias is defined for each name whose value is given. A trailing space in value causes the next word to be checked for
alias substitution when the alias is expanded. For each name in the argument list for which no value is supplied, the name and value of
the alias is printed. Alias returns true unless a name is given for which no alias has been defined.
Note aliases are not expanded by default in non-interactive shell, and it can be enabled by setting the expand_aliases shell option using
shopt.
alias 命令
作用: 设置命令别名,可以将较长的命令进行简化,使用alias 时,用户必须使用单引号将原来的命令引起来,防止特殊字符导致错误。
如要永久生效则将alias 命令存放到bash 的初始化文件 /etc/bashrc中。
语法:alias (选项)(参数)选项:-p: 打印已经设置的目录别名参数:命令别名 = 实际命令实例:alias 新命令= '原命令 -选项/ 参数'alias l ='ls -lsh'
删除别名: unalias 别名
查看系统设置的别名: 键入 alias
相关文章推荐
- 改版时保留原链接,创建新的URL的方法
- nginx,apache的alias和认证功能
- nginx目录设置 alias 和 root
- cd命令
- 文件查找 /which/whereis/locate/find/grep
- 2015-03-13 第三课 ls,cd,alias,PATH,目录结构,快捷键
- CentOS安装gcc报错的问题
- cp直接覆盖不提示按Y/N的方法
- openwrt中luci学习笔记
- linux alias方法临时失效的几种方法
- 龙芯8089d - gentoo - alias更改永久
- linux下新建alias,退出后失效的问题
- 解决linux cp -rf还提示覆盖的方法
- LINUX中快速进入某个目录
- ubuntu中把自定义的alias别名导入./bashrc
- nginx location的root和alias区别
- linux目录太长怎么办?分享一点小技巧
- Linux中命令别名的使用
- bash配置文件中alias错误会引起shell异常
- linux命令的别名alias,unalias