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

2022-05-13 17:20:39 字數 784 閱讀 3355

各位看官,

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

-rw-r--r--.1root 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--.2root root 3 aug  1 07:49 test1.c

262594 -rw-r--r--.2root 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--.1root root 3 aug  1 07:49 test1.c     #變回來了吧,注意很多資料說這個值不變,還是2,是錯誤的。

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

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

各位看官,root luozhonghua aaa ls l test.c rw r r 1root root 3 aug 1 07 49 test.c 看加粗1 原始test.c檔案索引節點值為1,也就是每個檔案第一次生成時候都是唯一的1值 root luozhonghua aaa ln test...

Linux 索引節點 inode

理解 inode,要從檔案儲存說起。檔案儲存在硬碟上,硬碟的最小儲存單位叫做 扇區 sector 每個扇區儲存 512 位元組 相當於 0.5kb 作業系統讀取硬碟的時候,不會乙個個扇區地讀取,這樣效率太低,而是一次性連續讀取多個扇區,即一次性讀取乙個 塊 block 這種由多個扇區組成的 塊 是檔...

linux 索引節點 inode 詳解

1 inode簡介 理解inode,要從檔案儲存說起。檔案儲存在硬碟上,硬碟的最小儲存單位叫做 扇區 sector 每個扇區儲存512位元組 相當於0.5kb 作業系統讀取硬碟的時候,不會乙個個扇區地讀取,這樣效率太低,而是一次性連續讀取多個扇區,即一次性讀取乙個 塊 block 這種由多個扇區組成...