如题所述
ä¿®æ¹ç¨æ·ç¯å¢åé
ç¨æ·ç¯å¢åéé常被åå¨å¨ä¸é¢çæ件ä¸ï¼
~/.profile
~/.bash_profile æè ~./bash_login
~/.bashrc
ä¸è¿°æ件å¨Ubuntu 10.0以åçæ¬ä¸æ¨è使ç¨ã
ç³»ç»ç¯å¢åé
ç³»ç»ç¯å¢åéä¸è¬ä¿åå¨ä¸é¢çæ件ä¸ï¼
/etc/environment
/etc/profile
/etc/bash.bashrc
/etc/profileå /etc/bash.bashrcå¨Ubuntu 10.0çæ¬ä¸ä¸æ¨è使ç¨ã
å å ¥ç¯å¢åé
å¦æ³å°ä¸ä¸ªè·¯å¾å å ¥å°$PATHä¸ï¼å¯ä»¥åä¸é¢è¿æ ·åï¼ä¿®æ¹/etc/profileï¼ï¼
$ sudo nano /etc/profile
å¨éé¢å å ¥:
export PATH="$PATH:/my_new_path"
ä½ å¯ä»¥èªå·±å ä¸æå®çå¤ä¸ªè·¯å¾ï¼ä¸é´ç¨åå·éå¼ãç¯å¢åéæ´æ¹åï¼å¨ç¨æ·ä¸æ¬¡ç»éæ¶çæï¼å¦ææ³ç«å»çæï¼åå¯æ§è¡ä¸é¢çè¯å¥ï¼
$source /etc/profile
éè¦æ³¨æçæ¯ï¼æ好ä¸è¦æå½åè·¯å¾â./âæ¾å°PATHéï¼è¿æ ·å¯è½ä¼åå°ææ³ä¸å°çæ»å»ã
å ¶ä»æ件çä¿®æ¹æ¹å¼ä¸æ¤ç±»ä¼¼ï¼éè¦æ³¨æçæ¯/etc/environmentä¸éè¦ä½¿ç¨export设置ç¯å¢åéï¼å ¶ä»profileæ件éè¦ã
ç¨æ·ç¯å¢åéé常被åå¨å¨ä¸é¢çæ件ä¸ï¼
~/.profile
~/.bash_profile æè ~./bash_login
~/.bashrc
ä¸è¿°æ件å¨Ubuntu 10.0以åçæ¬ä¸æ¨è使ç¨ã
ç³»ç»ç¯å¢åé
ç³»ç»ç¯å¢åéä¸è¬ä¿åå¨ä¸é¢çæ件ä¸ï¼
/etc/environment
/etc/profile
/etc/bash.bashrc
/etc/profileå /etc/bash.bashrcå¨Ubuntu 10.0çæ¬ä¸ä¸æ¨è使ç¨ã
å å ¥ç¯å¢åé
å¦æ³å°ä¸ä¸ªè·¯å¾å å ¥å°$PATHä¸ï¼å¯ä»¥åä¸é¢è¿æ ·åï¼ä¿®æ¹/etc/profileï¼ï¼
$ sudo nano /etc/profile
å¨éé¢å å ¥:
export PATH="$PATH:/my_new_path"
ä½ å¯ä»¥èªå·±å ä¸æå®çå¤ä¸ªè·¯å¾ï¼ä¸é´ç¨åå·éå¼ãç¯å¢åéæ´æ¹åï¼å¨ç¨æ·ä¸æ¬¡ç»éæ¶çæï¼å¦ææ³ç«å»çæï¼åå¯æ§è¡ä¸é¢çè¯å¥ï¼
$source /etc/profile
éè¦æ³¨æçæ¯ï¼æ好ä¸è¦æå½åè·¯å¾â./âæ¾å°PATHéï¼è¿æ ·å¯è½ä¼åå°ææ³ä¸å°çæ»å»ã
å ¶ä»æ件çä¿®æ¹æ¹å¼ä¸æ¤ç±»ä¼¼ï¼éè¦æ³¨æçæ¯/etc/environmentä¸éè¦ä½¿ç¨export设置ç¯å¢åéï¼å ¶ä»profileæ件éè¦ã
温馨提示:答案为网友推荐,仅供参考