ÕÆÎÕLinuxϵͳÖз¾¶ÌåÏÖ·¨£º¾ø¶Ô·¾¶ÓëÏà¶Ô·¾¶
ÕÆÎÕLinuxϵͳÖз¾¶ÌåÏÖ·¨£º¾ø¶Ô·¾¶ÓëÏà¶Ô·¾¶
ÔÚLinuxϵͳÖУ¬Â·¾¶ÌåÏÖ·¨ÊǺÜÊÇÖ÷ÒªµÄ»ù´¡ÖªÊ¶£¬ÌØÊâÊǹØÓÚ¿ª·¢Ö°Ô±ºÍϵͳÖÎÀíÔ±À´Ëµ¡£Â·¾¶ÌåÏÖ·¨Ö÷Òª·ÖΪ¾ø¶Ô·¾¶ºÍÏà¶Ô·¾¶Á½ÖÖ£¬±¾ÎĽ«Í¨¹ýÏêϸµÄ´úÂëʾÀýÀ´ËµÃ÷ÕâÁ½ÖÖ·¾¶ÌåÏÖ·¨µÄÇø±ðºÍÓ÷¨¡£
Ò»¡¢¾ø¶Ô·¾¶
¾ø¶Ô·¾¶ÊÇ´Ó¸ùĿ¼×îÏȵÄÍêÕû·¾¶£¬ÌåÏÖÎļþ»òĿ¼ÔÚÕû¸öÎļþϵͳÖеÄλÖ᣾ø¶Ô·¾¶ÒÔб¸Ü¡°/¡±¿ªÍ·£¬ÀýÈ磺/home/user/Documents£¬ÆäÖС°/¡±´ú±í¸ùĿ¼£¬ÒÀ´ÎÊÇ·¾¶Öеĸ÷¼¶Ä¿Â¼¡£¾ø¶Ô·¾¶Ê¼ÖÕÊÇÀο¿µÄ£¬²»ÊÜÄ¿½ñÊÂÇéĿ¼µÄÓ°Ïì¡£
ÔÚÖÕ¶ËÖУ¬¿ÉÒÔʹÓÃÈçÏ´úÂëʾÀýÉó²éÄ¿½ñÊÂÇéĿ¼ÒÔ¼°Ä³¸öÎļþµÄ¾ø¶Ô·¾¶£º
# Éó²éÄ¿½ñÊÂÇéĿ¼ pwd # Éó²éij¸öÎļþµÄ¾ø¶Ô·¾¶ realpath filename
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ÈôÊÇÄ¿½ñÊÂÇéĿ¼ÊÇ¡°/home/user¡±£¬ÒªÉó²éÎļþ¡°example.txt¡± µÄ¾ø¶Ô·¾¶£¬¿ÉÒÔÖ´ÐÐÒÔÏÂÏÂÁ
realpath example.txt
µÇ¼ºó¸´ÖÆ
¶þ¡¢Ïà¶Ô·¾¶
Ïà¶Ô·¾¶ÊÇÏà¹ØÓÚÄ¿½ñÊÂÇéĿ¼µÄ·¾¶ÌåÏÖ·¨£¬²»ÒÔ¡°/¡±¿ªÍ·¡£Ïà¶Ô·¾¶¿ÉÒÔ¸üΪ¾«Á·µØÌåÏÖÄ¿µÄÎļþ»òĿ¼ÓëÄ¿½ñλÖõÄÏà¶ÔλÖùØϵ¡£ÔÚʹÓÃÏà¶Ô·¾¶Ê±£¬ÐèÒªÇåÎúÄ¿½ñËù´¦µÄλÖ㬲»È»»á·ºÆ𷾶¹ýʧ¡£
ÀýÈ磬ÔÚÄ¿½ñÊÂÇéĿ¼¡°/home/user¡±Ï£¬ÓÐÒ»¸ö×ÓĿ¼¡°Documents¡±£¬ÒªÉó²é¸ÃĿ¼ÏµÄÎļþ¡°notes.txt¡±£¬¿ÉÒÔʹÓÃÏà¶Ô·¾¶£º
# ʹÓÃÏà¶Ô·¾¶Éó²éÎļþ cd Documents cat notes.txt
µÇ¼ºó¸´ÖÆ
ÉÏÊö´úÂëʾÀýÖУ¬Ê×ÏȽøÈëÁË¡°Documents¡±Ä¿Â¼£¬È»ºóÉó²éÁËÆäÖеÄÎļþ¡°notes.txt¡±¡£
×ܽ᣺
¾ø¶Ô·¾¶ÊÇ´Ó¸ùĿ¼×îÏȵÄÍêÕû·¾¶£¬ÒÔ¡°/¡±¿ªÍ·£¬Ê¼ÖÕÀο¿¡£
Ïà¶Ô·¾¶ÊÇÏà¹ØÓÚÄ¿½ñÊÂÇéĿ¼µÄ·¾¶ÌåÏÖ·¨£¬²»ÒÔ¡°/¡±¿ªÍ·£¬¸üΪ¾«Á·¡£
ͨ¹ýÕÆÎÕ¾ø¶Ô·¾¶ºÍÏà¶Ô·¾¶µÄ¿´·¨¼°Ê¹ÓÃÒªÁ죬¿ÉÒÔÔ½·¢ÎÞаµØÔÚLinuxϵͳÖÐÖÎÀíÎļþºÍĿ¼£¬Ìá¸ßÊÂÇéЧÂÊ¡£
ÒÔÉÏÊǹØÓÚÔÚLinuxϵͳÖÐÕÆÎÕ·¾¶ÌåÏÖ·¨µÄÏÈÈÝ£¬Ï£ÍûÄܹ»¶Ô¶ÁÕßÓÐËù×ÊÖú¡£
ÒÔÉϾÍÊÇÕÆÎÕLinuxϵͳÖз¾¶ÌåÏÖ·¨£º¾ø¶Ô·¾¶ÓëÏà¶Ô·¾¶µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡