×ðÁú¿­Ê±

ѧ»áÔÚLinuxÖÐÉó²éÄ¿½ñ·¾¶

ÎÊÌ⣺ѧ»áÔÚLinuxÖÐÉó²éÄ¿½ñ·¾¶µÄÒªÁì¼°´úÂëʾÀý

ÔÚLinux²Ù×÷ϵͳÖУ¬¾­³£ÐèÒªÉó²éÄ¿½ñËùÔڵķ¾¶£¬ÒÔ±ã¸üºÃµØ¶¨Î»ºÍ²Ù×÷ÎļþºÍĿ¼¡£±¾ÎĽ«ÏÈÈÝÔÚLinuxÖÐÉó²éÄ¿½ñ·¾¶µÄ¼¸ÖÖÒªÁ죬²¢ÌṩÏêϸµÄ´úÂëʾÀý¡£Ï£ÍûÄÜ×ÊÖú¶ÁÕßÔ½·¢ÊìÁ·µØÔÚLinuxÇéÐÎÖоÙÐз¾¶²Ù×÷¡£

1. ʹÓÃpwdÏÂÁî

pwdÊÇPrint Working DirectoryµÄËõд£¬ÓÃÓÚÏÔʾĿ½ñÊÂÇéĿ¼µÄÍêÕû·¾¶¡£Í¨¹ýÔÚÖÕ¶ËÊäÈëpwdÏÂÁ¼´¿ÉÏÔʾĿ½ñ·¾¶¡£

ʾÀý´úÂ룺

pwd

µÇ¼ºó¸´ÖÆ

2. ʹÓÃechoÏÂÁî

echoÏÂÁîÓÃÓÚÏÔʾһÐÐÎı¾£¬²¢¿É½«Îı¾Öض¨Ïòµ½ÎļþÖС£µ±ÍŽá$PWDÇéÐαäÁ¿Ê¹ÓÃʱ£¬Ò²¿ÉÒÔÏÔʾĿ½ñ·¾¶¡£

ʾÀý´úÂ룺

echo $PWD

µÇ¼ºó¸´ÖÆ

3. ʹÓÃreadlinkÏÂÁî

readlinkÏÂÁî¿ÉÒÔÏÔʾ·ûºÅÁ´½ÓµÄÄ¿µÄ·¾¶¡£µ±ÍŽá-fÑ¡ÏîʹÓÃʱ£¬¿ÉÒÔ»ñÈ¡Ä¿½ñ¾ø¶Ô·¾¶¡£

ʾÀý´úÂ룺

readlink -f .

µÇ¼ºó¸´ÖÆ

4. ʹÓÃdirnameÏÂÁî

dirnameÏÂÁîÓÃÓÚÈ¥µô×îºó²ã¼¶µÄ·¾¶£¬²¢Êä³öÉÏÒ»²ãµÄĿ¼¡£ÍŽá$PWDÇéÐαäÁ¿Ê¹ÓÃʱ£¬¿ÉÒÔÏÔʾĿ½ñ·¾¶¡£

ʾÀý´úÂ룺

dirname $PWD

µÇ¼ºó¸´ÖÆ

5. ʹÓÃpwdxÏÂÁî

pwdxÏÂÁî¿ÉÒÔÏÔʾָ¶¨Àú³ÌµÄÊÂÇéĿ¼¡£Í¨¹ý½«Ä¿½ñÀú³ÌµÄPID£¨Process ID£©×÷Ϊ²ÎÊýת´ï¸øpwdxÏÂÁ¼´¿ÉÏÔʾĿ½ñÀú³ÌµÄÊÂÇéĿ¼¡£

ʾÀý´úÂ룺

pwdx $(echo $$)

µÇ¼ºó¸´ÖÆ

ÒÔÉÏÊǼ¸ÖÖÔÚLinuxÖÐÉó²éÄ¿½ñ·¾¶µÄÒªÁì¼°´úÂëʾÀý¡£Í¨¹ýÊìÁ·ÕÆÎÕÕâЩҪÁ죬½«Äܹ»Ô½·¢Àû±ãµØÔÚLinuxϵͳÖоÙÐз¾¶²Ù×÷£¬Ìá¸ßÊÂÇéЧÂÊ¡£Ï£Íû¶ÁÕßͨ¹ýʵ¼ùÔËÓÃÕâЩҪÁ죬Äܹ»ÔÚLinuxÇéÐÎÏÂÔ½·¢¼ÝÇá¾ÍÊìµØ¾ÙÐÐÎļþºÍĿ¼ÖÎÀí¡£

ÒÔÉϾÍÊÇѧ»áÔÚLinuxÖÐÉó²éÄ¿½ñ·¾¶µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

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

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

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