ln ÃüÁîÓÃÓÚÔÚÎļþÖ®¼ä½¨Á¢Á¬½Ó£¬ÊÇlinux ÖÐÒ»¸ö·Ç³£ÖØÒªµÄÃüÁî¡£Á´½ÓÎļþ¾ÍÀàËÆÓë΢ÈíwindowsµÄ¿ì½Ý·½Ê½£¬Ö»±£ÁôÄ¿±êÎļþµÄµØÖ·£¬¶ø²»Õ¼Óô洢¿Õ¼ä¡£Ê¹ÓÃÁ´½ÓÎļþÓëʹÓÃÄ¿±êÎļþµÄЧ¹ûÊÇÒ»ÑùµÄ¡£¿ÉΪÁ´½ÓÎļþÖ¸¶¨²»Í¬µÄ·ÃÎÊȨÏÞ£¬ÒÔ¿ØÖƶÔÎļþµÄ¹²ÏíºÍ°²È«ÐÔÎÊÌâ¡£
linux ÖÐÓÐÁ½ÖÖÀàÐ͵ÄÁ´½Ó£º
1.Ó²Á´½ÓÊÇÀûÓÃlinux ÖÐÿ¸öÎļþ·ÖÅäµÄÎïÀí±àºÅ¡ªinode ½¨Á¢Á¬½Ó¡£Òò´Ë£¬Ó²Á´½Ó²»ÄÜ¿çÔ½Îļþϵͳ¡£
2.ÈíÁ¬½Ó£¨·ûºÅÁ´½Ó£©ÊÇÀûÓÃÎļþµÄ·¾¶Ãû½¨Á¢Á¬½Ó¡£Í¨³£½¨Á¢ÈíÁ¬½ÓʹÓþø¶Ô·¾¶¶ø²»ÊÇÏà¶Ô·¾¶£¬ÒÔ×î´óÏÞ¶ÈÔö¼Ó¿ÉÒÆÖ²ÐÔ¡£
ÐèҪעÒâµÄÊÇ£¬Èç¹ûÐÞ¸ÄÓ²Á´½ÓµÄÄ¿±êÎļþÃû£¬Á´½ÓÒÀÈ»ÓÐЧ£»Èç¹ûÐÞ¸ÄÈíÁ¬½ÓµÄÄ¿±êÎļþÃû£¬ÔòÁ´½Ó½«¶Ï¿ª£»¶ÔÒ»¸öÒÑ´æÔÚµÄÁ´½ÓÎļþÖ´ÐÐÒƶ¯»òɾ³ý²Ù×÷£¬ÓпÉÄܵ¼ÖÂÁ´½ÓµÄ¶Ï¿ª¡£¼ÙÈçɾ³ýÄ¿±êÎļþºó£¬ÖØд´½¨Ò»¸öͬÃûÎļþ£¬ÈíÁ¬½Ó½«»Ö¸´£¬Ó²Á´½Ó²»ÔÙÓÐЧ£¬ÒòΪÎļþµÄinode ÒѾ¸Ä±ä
ʾÀý£ºÔÚĿ¼/bashÏ´´½¨Ò»¸ö·ûºÅÁ´½ÓÎļþmmp,ʹËüÖ¸ÏòĿ¼ /bash/1.c
[root@xyd /]# ln -s /bash/1.c /bash/mmp [root@xyd /]# ls -s ×ÜÓÃÁ¿ 110 4 bash 0 dev 16 lost+found 0 net 4 rootfs 0 sys 4 var 4 bin 12 etc 4 media 4 opt 12 sbin 4 tmp 2 boot 4 home 0 misc 0 proc 0 selinux 4 tools 4 cgroup 12 lib 4 mnt 4 root 4 srv 4 usr [root@xyd /]# cd /bash/ [root@xyd bash]# ls 1 1.c 2 hello.sh hello.sh~ mmp tmp [root@xyd bash]# ls -l mmp lrwxrwxrwx. 1 root root 9 3Ô 11 20:58 mmp -> /bash/1.c |
¸ÃÃüÁîÖ´Ðкó£¬/bash /1.c´ú±íµÄ·¾¶½«´æ·ÅÔÚÃûΪ /bash/mmp ÎļþÖС£
ʾÀý2 £º½«Ä¿Â¼/bash/1.c Á´½Óµ½/bash/tmp.c Îļþ
root@xyd /]# ln /bash/1.c /bash/tmp.c [root@xyd /]# ls -l /bash/tmp.c -rw-r--r--. 2 root root 6 3ÔÂ 8 19:23 /bash/tmp.c [root@xyd /]# |
×¢Ò⣺ÔÚÖ´ÐÐln ÃüÁî֮ǰ£¬Ä¿Â¼/bash/tmp.c ÎļþÊDz»´æÔڵġ£ÔÚÖ´ÐÐln Ö®ºó£¬²Å»á²úÉútmp.c Îļþ¡£Õâ±íÃ÷¶þÕßÎļþÊÇÁ´½ÓÆðÀ´µÄ¡££¨×¢ÒâÔÚÎïÀíÉ϶þÕßÊÇͬһÎļþ£©¡£
˵Ã÷£ºln ÃüÁî»á±£³Öÿһ´¦Á´½ÓÎļþµÄͬ²½ÐÔ£¬Ò²¾ÍÊÇ˵£¬²»Â۸Ķ¯ÁËÄÄÒ»´¦£¬ÆäËûµÄÎļþ¶¼»á·¢ÉúÏàͬµÄ±ä»¯¡£
ln µÄÁ´½ÓÓÐÈíÁ¬½ÓºÍÓ²Á´½ÓÁ½ÖÖ£º
ÈíÁ´½Ó¾ÍÊÇÉÏÃæʾÀýÖÐµÄ ln ¨Cs *******,ËüÖ»»áÔÚÓû§Ñ¡¶¨µÄλÖÃÉÏÉú³ÉÒ»¸öÎļþµÄ¾µÏñ£¬²»»áÖظ´Õ¼Óÿռ䣬ƽʱʹÓý϶àµÄ¶¼ÊÇÈíÁ¬½Ó¡£
Ó²Á´½ÓÊDz»´ø²ÎÊýµÄln *****,Ëü»áÔÚÓû§Ñ¡¶¨µÄλÖÃÉÏÉú³ÉÒ»¸öºÍÔ´Îļþ´óСÏàͬµÄÎļþ¡£ÎÞÂÛÊÇÈíÁ¬½Ó»¹ÊÇÓ²Á´½Ó£¬Îļþ¶¼»á±£³Öͬ²½±ä»¯¡£