linux发行版本中centos就预设了很多方便的alias命令别名,这就是为什么很多人感觉centos系列使用上更加顺手的原因之一。linux的用户配置文件分为通用配置文件和用户个性化配置文件,分别对应/etc/profile.d/下的文件和~/.bashrc。
alias命令用于设置指令的别名,例如:命令执行、脚本执行
# 查看系统默认内置别名 [root@localhost ~]# 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'
用户shell配置文件 ~/.bashrc 下只存有3个别名,Linux各个发行版本
[root@localhost ~]# cat ~/.bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi
其他的别名都存在 /etc/profile.d/ 目录下面
[root@localhost ~]# cd /etc/profile.d/ [root@localhost profile.d]# ll total 64 -rw-r--r--. 1 root root 771 Nov 6 2016 256term.csh -rw-r--r--. 1 root root 841 Nov 6 2016 256term.sh -rw-r--r--. 1 root root 196 Apr 29 2015 colorgrep.csh -rw-r--r--. 1 root root 201 Apr 29 2015 colorgrep.sh -rw-r--r--. 1 root root 1741 Nov 5 2016 colorls.csh -rw-r--r--. 1 root root 1606 Nov 5 2016 colorls.sh -rw-r--r--. 1 root root 92 Jun 10 2014 cvs.csh -rw-r--r--. 1 root root 78 Jun 10 2014 cvs.sh -rw-r--r--. 1 root root 1706 Nov 6 2016 lang.csh -rw-r--r--. 1 root root 2703 Nov 6 2016 lang.sh -rw-r--r--. 1 root root 123 Jul 31 2015 less.csh -rw-r--r--. 1 root root 121 Jul 31 2015 less.sh -rw-r--r--. 1 root root 105 Aug 2 2017 vim.csh -rw-r--r--. 1 root root 269 Aug 2 2017 vim.sh -rw-r--r--. 1 root root 164 Jan 28 2014 which2.csh -rw-r--r--. 1 root root 169 Jan 28 2014 which2.sh
《计算机软件保护条例》第十七条:为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬。您需知晓本站提供的所有下载附件资源均来自互联网,仅供学习和交流研究使用,版权归属原版权方所有,版权争议与本站无关。用户本人下载后需在24小时内删除,不可用于商业和违法行为用途,否则后果由使用者自负。
评论