xx目录添加到PATH中:
1.【当前终端生效】:
执行命令:PATH=$PATH:xx
2.【所有用户生效】:
(1)在/etc/profile中追加:PATH=$PATH:xx
(2)source /etc/profile
或者. /etc/profile
或者 重新登入该用户
3.【当前用户生效】:
(1)在~/.bash_profile中追加:PATH=$PATH:xx
(2). ~/.bash_profile
或者 重新登入该用户
PS:
如果,将shell脚本放置在现有的PATH路径下(建议/usr/local/bin下),也可以如使用系统命令般直接运行命令。