linux索引節點及值(弄清十分必要)

來源:互聯網
上載者:User

linux索引節點及值(弄清十分必要)

各位看官,

[root@luozhonghua aaa]# ls -l test.c

-rw-r--r--. 1 root root 3 Aug 1 07:49 test.c #看加粗1 原始test.c檔案索引節點值為1,也就是每個檔案第一次產生時候都是唯一的1值
[root@luozhonghua aaa]# ln test.c test1.c #永久連結檔案test1.c
[root@luozhonghua aaa]# ls -li test*
262594 -rw-r--r--. 2 root root 3 Aug 1 07:49 test1.c

262594 -rw-r--r--. 2 root root 3 Aug 1 07:49 test.c #這裡為什麼變成2呢,是因為永久連結時自動增1,其實很好理解,linux檔案系統就是一個樹節點的結構,想想就清楚了

#再看,如果我刪除 test.c 看看

[root@luozhonghua aaa]# rm -rf test.c
[root@luozhonghua aaa]# ls -li test*
262594 -rw-r--r--. 1 root root 3 Aug 1 07:49 test1.c #變回來了吧,注意很多資料說這個值不變,還是2,是錯誤的。

總而言之,linux就是一個樹節點系統,由樹節點檔案組成,操作一切檔案都與樹的邏輯相同

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.