LinuxÖÐPATHÇéÐαäÁ¿µÄ×÷ÓúÍÖ÷ÒªÐÔ
¡¶LinuxÖÐPATHÇéÐαäÁ¿µÄ×÷ÓúÍÖ÷ÒªÐÔ¡·
PATHÇéÐαäÁ¿ÊÇLinuxϵͳÖкÜÊÇÖ÷ÒªµÄÇéÐαäÁ¿Ö®Ò»£¬Ëü½ç˵ÁËϵͳÔÚÄÄЩĿ¼ÖÐÑ°ÕÒ¿ÉÖ´ÐгÌÐò¡£ÔÚLinuxϵͳÖУ¬µ±Óû§ÔÚÖÕ¶ËÊäÈëÒ»¸öÏÂÁîʱ£¬ÏµÍ³»áÔÚPATHÇéÐαäÁ¿ËùÁгöµÄĿ¼ÖÐÖð¸ö²éÕÒÊÇ·ñ±£´æ¸ÃÏÂÁîµÄ¿ÉÖ´ÐÐÎļþ£¬ÈôÊÇÕÒµ½ÔòÖ´ÐУ¬²»È»»áÌáÐÑ¡°command not found¡±¡£
PATHÇéÐαäÁ¿µÄ×÷Óãº
¼ò»¯ÏÂÁîµÄÊäÈ룺½«¿ÉÖ´ÐгÌÐòËùÔÚµÄĿ¼Ìí¼Óµ½PATHÖУ¬¿ÉÒÔÖ±½ÓÔÚÖÕ¶ËÊäÈëÏÂÁ¶ø²»±ØÊäÈëÍêÕûµÄ³ÌÐò·¾¶¡£
Ìá¸ßϵͳµÄÖ´ÐÐЧÂÊ£ºÍ¨¹ýÉèÖÃPATHÇéÐαäÁ¿£¬ÏµÍ³¿ÉÒÔ¿ìËÙÕÒµ½¿ÉÖ´ÐгÌÐòµÄλÖã¬ïÔÌÁËϵͳ²éÕÒÎļþµÄʱ¼ä¡£
Àû±ãÖÎÀíºÍά»¤£ºÍ¨¹ýͳһÖÎÀíPATHÇéÐαäÁ¿£¬¿ÉÒÔÀû±ãµØÌí¼Ó¡¢É¾³ý»òÐ޸ijÌÐòµÄ·¾¶£¬Ìá¸ßϵͳµÄ¿Éά»¤ÐÔ¡£
ÏÂÃæͨ¹ýÏêϸµÄ´úÂëʾÀýÀ´ËµÃ÷PATHÇéÐαäÁ¿µÄÉèÖúÍʹÓãº
Éó²éÄ¿½ñPATHÇéÐαäÁ¿µÄÖµ£º
ÔÚÖÕ¶ËÊäÈëÒÔÏÂÏÂÁî¿ÉÒÔÉó²éÄ¿½ñµÄPATHÇéÐαäÁ¿ÉèÖãº
echo $PATH
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
Ìí¼ÓеÄĿ¼µ½PATHÇéÐαäÁ¿ÖУº
¼ÙÉèÎÒÃÇÓÐÒ»¸ö×Ô½ç˵µÄ³ÌÐò´æ·ÅÔÚ/usr/local/myprogramĿ¼Ï£¬ÐèÒª½«¸ÃĿ¼Ìí¼Óµ½PATHÖУº
export PATH=$PATH:/usr/local/myprogram
µÇ¼ºó¸´ÖÆ
Ñé֤еÄĿ¼ÊÇ·ñÌí¼ÓÀֳɣº
¿ÉÒÔͨ¹ýÊäÈëÒÔÏÂÏÂÁîÑé֤еÄĿ¼ÊÇ·ñÀÖ³ÉÌí¼Óµ½PATHÖУº
echo $PATH
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ʹÓÃ×Ô½ç˵³ÌÐò£º
ÏÖÔÚ¿ÉÒÔÖ±½ÓÔÚÖÕ¶ËÊäÈë¸Ã³ÌÐòµÄÃû³Æ£¬ÏµÍ³»áÔÚPATHÖвéÕҸóÌÐò²¢Ö´ÐУº
myprogram
µÇ¼ºó¸´ÖÆ
ͨ¹ýÒÔÉÏ´úÂëʾÀý£¬ÎÒÃÇ¿ÉÒÔ¿´µ½ÔÚLinuxϵͳÖÐÔõÑùÉèÖúÍʹÓÃPATHÇéÐαäÁ¿¡£×¼È·ÉèÖÃPATHÇéÐαäÁ¿²»µ«¿ÉÒÔÌá¸ßϵͳµÄÖ´ÐÐЧÂÊ£¬»¹Äܼò»¯ÏÂÁîÊäÈ룬Ìá¸ßϵͳµÄ¿Éά»¤ÐÔ¡£ÔÚÒ»Ñùƽ³£Ê¹ÓÃLinuxϵͳʱ£¬ºÏÀíÉèÖÃPATHÇéÐαäÁ¿ÊǺÜÊÇÖ÷ÒªµÄ¡£
ÒÔÉϾÍÊÇLinuxÖÐPATHÇéÐαäÁ¿µÄ×÷ÓúÍÖ÷ÒªÐÔµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡