对于经常执行的较长的命令,可以将其定义成较短的别名,以方便执行

显示当前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进程重新读取配置文件

如果别名同原命令同名,如果要执行原命令,可使用

最新文章

  1. Handler
  2. POJ 1088
  3. 访问javaweb服务器sessionid存放问题
  4. 网页闯关游戏(riddle webgame)--仿微信聊天的前端页面设计和难点
  5. Linux 网络编程一(TCP/IP协议)
  6. 【Linux】inode_针对MySQL读写操作在系统层的进一步学习【转】
  7. Robot Framework 环境搭建
  8. epub显示特殊字体
  9. Unity3D 游戏的碰撞
  10. sql server更改机器名后更改数据库机器名
  11. Thinkphp---练习:数据的增删改查
  12. JS onkeydown控制HTML Input 只录入浮点数值
  13. Hibernate详细教程
  14. 复杂的1秒--图解Google搜索技术
  15. UNIX网络编程——僵尸进程
  16. Segmentation metrics
  17. 【Spring】12、Spring Security 四种使用方式
  18. Mordern Effective C++ --auto
  19. 2733: [HNOI2012]永无乡
  20. c#day05

热门文章

  1. LevelDb 101学习
  2. 吴恩达-机器学习+Logistic回归分类方案
  3. keras中的mask操作
  4. Python-生成器函数(协程实现底层原理)-yield
  5. python3 读取写入excel操作-win32com
  6. 用JTable 实现日历
  7. 实验 5:OpenFlow 协议分析和 OpenDaylight 安装
  8. Arduino 串行外设接口——W3Cschool
  9. 刷LeetCode的简易姿势
  10. 如何在yii2直接执行SQL