1. vi /etc/profile ,在文件末尾加上要定義的環境變量,語法以下:spa
export 變量名=變量值變量
2.:wq 退出file
3.source /etc/profile語法
source命令用法:source FileNameim
4. 輸入 env 查看環境變量,是否有本身定義的環境變量。img