如题所述
ãã1. å
¨å±ç对ææç¨æ·é½å¯ä»¥ç使ç¨çPATH: å¯ä»¥éè¿ä¿®æ¹é
ç½®æä»¶ï¼ /etc/bashrc å /etc/profile æ¥æ¶é
ç½®ï¼å
¨å±çPATH;
ä¾å¦ï¼ vi /etc/profile
å¨æååå ä¸è¡ï¼PATH=THE_SET_GLOBLE_ENV_PATH:$PATH;
æ¥çæ¢è¡ï¼ export PATH
å¦æä½¿å ¶ç«å³çæï¼ source /etc/profile
2. 对äºæ®éç¨æ·ä¹å¯ä»¥è®¾ç½®ï¼èªå·±çè·¯å¾ï¼å¨èªå·±çhomeç®å½ä¸ï¼
ls -a | grep bash
ä¼æ¾å°ä¸¤ä¸ªæä»¶ï¼ .bashrc å .bash_profile
åæ ·å¯ä»¥åä¿®æ¹ /etc/profileä¸æ ·ï¼ä¿®æ¹ .bash_profile æ¥é ç½®ä½ ç个æ§PATH ç¯å¢ã
åæ ·ä¿®æ¹åï¼è¥ä¸éå¯ï¼å°±ä½¿å ¶ç«å³çæçè¯ï¼ä¸è¦å¿äº source .bash_profile.
åµåµï¼æçççä½ çä¿®æ¹åçPATH: echo $PATH æè env åè set !!
ãã
ä¾å¦ï¼ vi /etc/profile
å¨æååå ä¸è¡ï¼PATH=THE_SET_GLOBLE_ENV_PATH:$PATH;
æ¥çæ¢è¡ï¼ export PATH
å¦æä½¿å ¶ç«å³çæï¼ source /etc/profile
2. 对äºæ®éç¨æ·ä¹å¯ä»¥è®¾ç½®ï¼èªå·±çè·¯å¾ï¼å¨èªå·±çhomeç®å½ä¸ï¼
ls -a | grep bash
ä¼æ¾å°ä¸¤ä¸ªæä»¶ï¼ .bashrc å .bash_profile
åæ ·å¯ä»¥åä¿®æ¹ /etc/profileä¸æ ·ï¼ä¿®æ¹ .bash_profile æ¥é ç½®ä½ ç个æ§PATH ç¯å¢ã
åæ ·ä¿®æ¹åï¼è¥ä¸éå¯ï¼å°±ä½¿å ¶ç«å³çæçè¯ï¼ä¸è¦å¿äº source .bash_profile.
åµåµï¼æçççä½ çä¿®æ¹åçPATH: echo $PATH æè env åè set !!
ãã
温馨提示:答案为网友推荐,仅供参考