ÏÔʾLinuxÎļþ·¾¶µÄÒªÁì
LinuxÖÐÏÔʾÎļþ·¾¶µÄÒªÁì
ÔÚLinux²Ù×÷ϵͳÖУ¬ÒªÉó²éÎļþµÄ·¾¶¿ÉÒÔʹÓÃһЩ¼òÆÓµÄÏÂÁî¡£ÕâЩÏÂÁîÄܹ»×ÊÖúÓû§¿ìËÙ¶¨Î»ÎļþËùÔÚµÄλÖã¬Àû±ãÖÎÀíºÍ²Ù×÷Îļþ¡£ÒÔϽ«ÏÈÈݼ¸ÖÖÏÔʾÎļþ·¾¶µÄÒªÁ죬²¢¸½ÉÏÏêϸµÄ´úÂëʾÀý¡£
1. ʹÓÃpwdÏÂÁî
pwdÏÂÁî¿ÉÒÔÏÔʾĿ½ñÊÂÇéĿ¼µÄ¾ø¶Ô·¾¶¡£Ö»ÐèÔÚÖÕ¶ËÖÐÊäÈëpwdÏÂÁ¼´¿ÉÏÔʾĿ½ñÊÂÇéĿ¼µÄÍêÕû·¾¶¡£ÒÔÏÂÊÇÒ»¸öʾÀý£º
$ pwd /home/user/Documents
µÇ¼ºó¸´ÖÆ
ÕâÌåÏÖÄ¿½ñÊÂÇéĿ¼ÊÇ/home/user/Documents¡£
2. ʹÓÃlsÏÂÁî
lsÏÂÁî¿ÉÒÔÁгöÄ¿½ñĿ¼ÏµÄËùÓÐÎļþºÍ×ÓĿ¼¡£ÈôÊÇÏëÉó²éÌض¨ÎļþµÄ·¾¶£¬¿ÉÒÔÔÚlsÏÂÁîºóÃæ¼ÓÉÏÎļþÃû¡£ÒÔÏÂÊÇÒ»¸öʾÀý£º
$ ls /home/user/Documents file1.txt file2.txt subfolder
µÇ¼ºó¸´ÖÆ
ÕâÀïÁгöÁË/home/user/DocumentsĿ¼ÏµÄËùÓÐÎļþºÍ×ÓĿ¼¡£
3. ʹÓÃfindÏÂÁî
findÏÂÁî¿ÉÒÔËÑË÷Ö¸¶¨Ä¿Â¼¼°Æä×ÓĿ¼ÖеÄÎļþ£¬²¢ÏÔʾËüÃǵÄ·¾¶¡£ÒÔÏÂÊÇÒ»¸öʾÀý£º
$ find /home/user/Documents -name file1.txt /home/user/Documents/file1.txt
µÇ¼ºó¸´ÖÆ
ÕâÀïÕÒµ½ÁËfile1.txtÎļþÔÚ/home/user/DocumentsĿ¼ÏµÄ·¾¶¡£
4. ʹÓÃrealpathÏÂÁî
realpathÏÂÁî¿ÉÒÔ½«Ïà¶Ô·¾¶×ª»»Îª¾ø¶Ô·¾¶£¬²¢ÏÔʾÎļþµÄÕæʵ·¾¶¡£ÒÔÏÂÊÇÒ»¸öʾÀý£º
$ realpath ../file.txt /home/user/Documents/file.txt
µÇ¼ºó¸´ÖÆ
ÕâÀォ../file.txtת»»ÎªÁË/home/user/Documents/file.txtµÄ¾ø¶Ô·¾¶¡£
×ܽ᣺ͨ¹ýÉÏÃæµÄÏÈÈÝ£¬ÎÒÃÇѧ»áÁËÔÚLinuxϵͳÖÐÏÔʾÎļþ·¾¶µÄ¼¸ÖÖÒªÁì¡£ÕâЩҪÁ춼ºÜÊÇÊÊÓ㬿ÉÒÔ×ÊÖúÎÒÃǸüÀû±ãµØÕÒµ½ºÍÖÎÀíÎļþ¡£Ï£ÍûÕâЩ´úÂëʾÀý¶ÔÄãÓÐËù×ÊÖú£¡
ÒÔÉϾÍÊÇÏÔʾLinuxÎļþ·¾¶µÄÒªÁìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡