linuxÇéÐαäÁ¿pathÔÚÄÄ
linuxÇéÐαäÁ¿path´æ´¢ÔÚÓû§µÄÉèÖÃÎļþÖУ¬Í¨³£Î»ÓÚÓû§Ö÷Ŀ¼ÏµÄÒ»¸öÒþ²ØÎļþ£¬ÃûΪ¡°.bashrc¡±»ò¡°.bash_profile¡±£¬ÕâЩÎļþ°üÀ¨ÁËÓû§µÇ¼ʱ¼ÓÔصÄÇéÐαäÁ¿ºÍÆäËûÉèÖÃÐÅÏ¢¡£
±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£
ÔÚ Linux ϵͳÖУ¬ÇéÐαäÁ¿ PATH ´æ´¢ÔÚÓû§µÄÉèÖÃÎļþÖС£ÏêϸÀ´Ëµ£¬Ëüͨ³£Î»ÓÚÓû§Ö÷Ŀ¼ÏµÄÒ»¸öÒþ²ØÎļþ£¬ÃûΪ .bashrc »ò .bash_profile¡£ÕâЩÎļþ°üÀ¨ÁËÓû§µÇ¼ʱ¼ÓÔصÄÇéÐαäÁ¿ºÍÆäËûÉèÖÃÐÅÏ¢¡£
Óû§µÄÉèÖÃÎļþ·¾¶ÈçÏ£º
¹ØÓÚͨË×Óû§£º~/.bashrc »ò ~/.bash_profile
¹ØÓÚ root Óû§£º/root/.bashrc »ò /root/.bash_profile
¿ÉÒÔʹÓÃÎı¾±à¼Æ÷£¨Èç vi¡¢nano µÈ£©·¿ªÏìÓ¦µÄÎļþ£¬Éó²éºÍ±à¼ PATH ÇéÐαäÁ¿¡£Ê¾ÀýÏÂÁîÈçÏ£º
vi ~/.bashrc
µÇ¼ºó¸´ÖÆ
ÔÚ·¿ªµÄÎļþÖУ¬Äã¿ÉÒÔÕÒµ½ÀàËÆÒÔϵÄÐÐÀ´ÉèÖà PATH ±äÁ¿£º
export PATH=/usr/local/bin:/usr/bin:/bin
µÇ¼ºó¸´ÖÆ
ÕâÊÇÒ»¸ö¼òÆÓµÄʾÀý£¬½«Èý¸ö·¾¶ /usr/local/bin¡¢/usr/bin ºÍ /bin Ìí¼Óµ½ PATH ±äÁ¿ÖС£Äã¿ÉÒÔ°´Ðè±à¼¸ÃÐУ¬½«ÐèÒªµÄ·¾¶Ìí¼Óµ½ PATH ±äÁ¿ÖУ¬ÓÃðºÅÍÑÀë¡£
±à¼ÉúÑĺó£¬Ö´ÐÐÒÔÏÂÏÂÁîʹÐÞ¸ÄÉúЧ£º
source ~/.bashrc
µÇ¼ºó¸´ÖÆ
ͨ¹ýÖ´ÐÐÉÏÊö²Ù×÷£¬Äã¿ÉÒÔÔÚÓû§µÄÉèÖÃÎļþÖÐÕÒµ½²¢ÐÞ¸Ä PATH ÇéÐαäÁ¿£¬ÒÔ˳ӦÄãµÄÐèÇó¡£
ÒÔÉϾÍÊÇlinuxÇéÐαäÁ¿pathÔÚÄĵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡