Linux命令之命令别名
2024-08-28 03:25:38
对于经常执行的较长的命令,可以将其定义成较短的别名,以方便执行
显示当前shell进程所有可用的命令别名
[04:33:43 root@C8[ ~]#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; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'
定义别名NAME,其相当于执行命令VALUE
范例:
撤消别名:unalias
注意:在命令行中定义的别名,仅对当前shell进程有效
如果想永久有效,要定义在配置文件中
仅对当前用户:~/.bashrc
对所有用户有效:/etc/bashrc
编辑配置给出的新配置不会立即生效,bash进程重新读取配置文件
如果别名同原命令同名,如果要执行原命令,可使用
最新文章
- Handler
- POJ 1088
- 访问javaweb服务器sessionid存放问题
- 网页闯关游戏(riddle webgame)--仿微信聊天的前端页面设计和难点
- Linux 网络编程一(TCP/IP协议)
- 【Linux】inode_针对MySQL读写操作在系统层的进一步学习【转】
- Robot Framework 环境搭建
- epub显示特殊字体
- Unity3D 游戏的碰撞
- sql server更改机器名后更改数据库机器名
- Thinkphp---练习:数据的增删改查
- JS onkeydown控制HTML Input 只录入浮点数值
- Hibernate详细教程
- 复杂的1秒--图解Google搜索技术
- UNIX网络编程——僵尸进程
- Segmentation metrics
- 【Spring】12、Spring Security 四种使用方式
- Mordern Effective C++ --auto
- 2733: [HNOI2012]永无乡
- c#day05