zhyiwww
          用平實(shí)的筆,記錄編程路上的點(diǎn)點(diǎn)滴滴………
          posts - 536,comments - 394,trackbacks - 0

          root@test-laptop:/tmp# ln /tmp/aa.txt  /tmp/bb.txt

          root@test-laptop:/tmp# file /tmp/aa.txt  
          /tmp/aa.txt: ASCII text
          硬鏈接文件是普通文件屬性。
          root@test-laptop:/tmp# file /tmp/bb.txt
          /tmp/bb.txt: ASCII text

          軟鏈接的文件屬性是鏈接文件。

          這應(yīng)該算一個(gè)區(qū)別。

          root@test-laptop:/tmp# ln -s /tmp/aa.txt  cc.txt

          root@test-laptop:/tmp# file /tmp/cc.txt
          /tmp/cc.txt: symbolic link to `/tmp/aa.txt'

          通過查看文件屬性,可以得到比較明顯的區(qū)別。
          root@test-laptop:/tmp# ls *.txt -la
          -rw-r--r-- 2 zy zy 28 2011-09-13 11:54 aa.txt
          -rw-r--r-- 2 zy zy 28 2011-09-13 11:54 bb.txt
          lrwxrwxrwx 1 zy zy 11 2011-09-13 11:54 cc.txt -> /tmp/aa.txt

          刪除硬鏈結(jié)文件,原文件不刪除。
          root@test-laptop:/tmp# rm bb.txt

          root@test-laptop:/tmp# ls -la *.txt
          -rw-r--r-- 1 zy zy 28 2011-09-13 11:54 aa.txt
          lrwxrwxrwx 1 zy zy 11 2011-09-13 11:54 cc.txt -> /tmp/aa.txt

          刪除軟鏈接文件,原文件也不刪除。

          有朋友說,刪除硬鏈結(jié),原文件就也刪除掉了。

          上面是我進(jìn)行的操作,結(jié)果,原文件沒有刪除。


          |----------------------------------------------------------------------------------------|
                                     版權(quán)聲明  版權(quán)所有 @zhyiwww
                      引用請(qǐng)注明來源 http://www.aygfsteel.com/zhyiwww   
          |----------------------------------------------------------------------------------------|
          posted on 2011-09-13 12:52 zhyiwww 閱讀(354) 評(píng)論(0)  編輯  收藏 所屬分類: linux
          主站蜘蛛池模板: 湖口县| 余江县| 乐都县| 昆山市| 宝坻区| 永泰县| 鄯善县| 卢龙县| 浑源县| 龙海市| 砀山县| 浦县| 炉霍县| 读书| 汉阴县| 北宁市| 靖宇县| 兰考县| 崇义县| 临西县| 赞皇县| 麻栗坡县| 西宁市| 孝感市| 北辰区| 澄迈县| 应用必备| 延川县| 绩溪县| 洛川县| 大安市| 沂南县| 伽师县| 河津市| 海伦市| 利辛县| 苏州市| 祁门县| 准格尔旗| 清丰县| 临桂县|