自定义系统命令缩写 分类: ubuntu 2013-07-15 17:42 344人阅读 评论(0) 收藏
添加系统全局变量:
步骤1:使用root用户登录,在家目录下修改.bash_profile文件,查看结果如下:
[root@server132 ~]# more .bash_profile
# .bash_profile# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
alias p='ps -ef|grep java'
alias rm='rm -i'
alias so='su - oracle'
alias sppd='/opt/jinrong/spider/bin/shutdown.sh'
alias sptm='/opt/jinrong/tomcat/bin/shutdown.sh'
alias stpd='/opt/xizang/spider/bin/startup.sh'
alias sttm='/opt/xizang/tomcat/bin/startup.sh'
alias tpd='tail -f /opt/jinrong/spider/logs/catalina.out'
alias ttm='tail -f /opt/xizang/tomcat/logs/catalina.out'
步骤2:
source ~/.bash_profile
关闭当前终端,重新打开终端,执行缩写命令即可
版权声明:本文为博主原创文章,未经博主允许不得转载。