第1種方法:
[root@lx_web_s1 ~]# export path=/usr/local/webserver/mysql/bin:$path
再次檢視:
[root@lx_web_s1 ~]# echo $path
/usr/local/webserver/mysql/bin:/usr/local/webserver/mysql/bin/:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
說明添加path成功。
上述方法的path 在終端關閉 後就會消失。是以還是建議通過編輯/etc/profile來改path,也可以修改家目錄下的.bashrc(即:~/.bashrc)。
第2種方法:
# vim /etc/profile
在最後,添加:
export path=$path:/usr/local/webserver/mysql/bin
儲存,退出,然後運作:
#source /etc/profile
不報錯則成功。
最新内容請見作者的github頁:http://qaseven.github.io/