尊龙凯时人生就是搏

ÔõÑù׼ȷÉèÖÃLinuxÖеÄPATHÇéÐαäÁ¿

ÔõÑù׼ȷÉèÖÃLinuxÖеÄPATHÇéÐαäÁ¿

ÔÚLinux²Ù×÷ϵͳÖÐ £¬ÇéÐαäÁ¿ÊÇÓÃÀ´´æ´¢ÏµÍ³¼¶±ðµÄÉèÖÃÐÅÏ¢µÄÖ÷Òª»úÖÆÖ®Ò»¡£ÆäÖÐ £¬PATHÇéÐαäÁ¿±»ÓÃÀ´Ö¸¶¨ÏµÍ³ÔÚÄÄЩĿ¼ÖвéÕÒ¿ÉÖ´ÐÐÎļþ¡£×¼È·ÉèÖÃPATHÇéÐαäÁ¿ÊÇÈ·±£ÏµÍ³Õý³£ÔËÐеÄÒªº¦Ò»²½¡£±¾ÎĽ«ÏÈÈÝÔõÑù׼ȷÉèÖÃLinuxÖеÄPATHÇéÐαäÁ¿ £¬²¢ÌṩÏêϸµÄ´úÂëʾÀý¡£

1. Éó²éÄ¿½ñPATHÇéÐαäÁ¿

ÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁî¿ÉÒÔÉó²éÄ¿½ñϵͳÖеÄPATHÇéÐαäÁ¿£º

echo $PATH

µÇ¼ºó¸´ÖÆ

ͨ¹ýÕâ¸öÏÂÁî £¬ÎÒÃÇ¿ÉÒÔ¿´µ½ÏµÍ³Ä¿½ñµÄPATHÇéÐαäÁ¿ÊÇÓɶà¸öĿ¼·¾¶×é³ÉµÄ £¬ÕâЩ·¾¶ÓÃðºÅ£¨:£©ÍÑÀ뿪¡£

2. ÐÞ¸ÄPATHÇéÐαäÁ¿

ÔÝʱÐÞ¸ÄPATHÇéÐαäÁ¿

ÈôÊÇÄãÖ»ÊÇÔÝʱÐèÒªÐÞ¸ÄPATHÇéÐαäÁ¿ £¬¿ÉÒÔÔÚÖÕ¶ËÖÐÖ±½ÓÊäÈëÒÔÏÂÏÂÁ

export PATH=/new/path:$PATH

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

ÕâÌõÏÂÁ/new/pathÌí¼Óµ½PATHÇéÐαäÁ¿µÄ×îÇ°Ãæ¡£Çë×¢ÖØ £¬ÕâÖÖÐ޸ķ½·¨Ö»ÔÚÄ¿½ñÖն˴°¿ÚÖÐÓÐÓà £¬ÖØÆôºó½«»áʧЧ¡£

ÓÀÊÀÐÞ¸ÄPATHÇéÐαäÁ¿

ÈôÊÇÄãÏ£ÍûÓÀÊÀÐÔµØÐÞ¸ÄPATHÇéÐαäÁ¿ £¬¿ÉÒԱ༭ÉèÖÃÎļþ.bashrc»ò.profile £¬Ïêϸ²Ù×÷ÈçÏ£º

·­¿ª~/.bashrc»ò~/.profileÎļþ£º

vi ~/.bashrc

µÇ¼ºó¸´ÖÆ

ÔÚÎļþĩβÌí¼ÓÒÔÏ´úÂ룺

export PATH=/new/path:$PATH

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

ÉúÑÄÎļþ²¢Í˳ö±à¼­Æ÷£»

ÊäÈëÒÔÏÂÏÂÁîʹÐÞ¸ÄÉúЧ£º

source ~/.bashrc

µÇ¼ºó¸´ÖÆ

3. ÑéÖ¤PATHÇéÐαäÁ¿ÊÇ·ñÉèÖÃ׼ȷ

ΪÁËÑéÖ¤PATHÇéÐαäÁ¿ÊÇ·ñ±»×¼È·ÉèÖà £¬¿ÉÒÔÊäÈëÒÔÏÂÏÂÁ

which executable_filename

µÇ¼ºó¸´ÖÆ

ÆäÖÐexecutable_filenameΪÄãÒª²éÕҵĿÉÖ´ÐÐÎļþÃû¡£ÈôÊÇÖÕ¶ËÄܹ»ÕÒµ½¸Ã¿ÉÖ´ÐÐÎļþ²¢Êä³öÆä·¾¶ £¬Ôò˵Ã÷PATHÇéÐαäÁ¿ÉèÖÃ׼ȷ¡£

½áÓï

׼ȷÉèÖÃLinuxÖеÄPATHÇéÐαäÁ¿¶ÔϵͳµÄÕý³£ÔËÐÐÖÁ¹ØÖ÷Òª¡£Í¨¹ý±¾ÎÄÏÈÈݵÄÒªÁì £¬Äã¿ÉÒÔÇáËɵØÐ޸ĺÍÑéÖ¤PATHÇéÐαäÁ¿¡£Ï£ÍûÕâЩÐÅÏ¢¶ÔÄãÓÐËù×ÊÖú £¬×£ÄãÔÚLinuxϵͳÖÐʹÓÃÓä¿ì£¡

Ïà¹ØÔĶÁ

[LinuxÇéÐαäÁ¿ÉèÖÃÏê½â](https://linuxtools-rst.readthedocs.io/zh_CN/latest/base/03_linuxenv.html)

[LinuxÇéÐαäÁ¿ÉèÖÃÐ޸ļ°ÉúЧҪÁì](https://cloud.tencent.com/developer/article/1781962)

²Î¿¼×ÊÁÏ

[Linux ÇéÐαäÁ¿µÄÉèÖúÍʹÓÃ](https://www.ibm.com/support/knowledgecenter/ssw_aix_72/com.ibm.aix.osdevice/env_variables.htm)

дµ½ÕâÀï £¬ÎÒÃÇÒѾ­ÏàʶÁËÔõÑù׼ȷÉèÖÃLinuxÖеÄPATHÇéÐαäÁ¿ £¬²¢ÇÒÌṩÁËÏìÓ¦µÄ´úÂëʾÀý¡£Ï£Íû±¾ÎĶÔÄúÓÐËù×ÊÖú £¬Ð»Ð»ÔĶÁ£¡

ÒÔÉϾÍÊÇÔõÑù׼ȷÉèÖÃLinuxÖеÄPATHÇéÐαäÁ¿µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ