vi /root/.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
如果要添加,你可以在
PATH=$PATH:$HOME/bin这句中,用:分隔添加
如PATH=$PATH:$HOME/bin:/usr/local/apache/bin
重新读取一下环境变量即可
这样apachectl这个命令就可以用tab直接键找到了
而不用把整个绝对路径找全,像这样/usr/local/apache/bin/apachectl
当然也可以用命令
export PATH=$PATH:$HOME/bin:/usr/local/apache/bin/
这样来解决


organization 于 2008-02-04 21:37:44发表:
这样方便了,可以在/HOME/bin里的程序无须绝对地址运行。