歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux索引節點及值

Linux索引節點及值

日期:2017/2/28 14:29:26   编辑:Linux教程

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

各位看官,

[[email protected] aaa]# ls -l test.c

-rw-r--r--. 1 root root 3 Aug 1 07:49 test.c #看加粗1 原始test.c文件索引節點值為1,也就是每個文件第一次生成時候都是唯一的1值
[[email protected] aaa]# ln test.c test1.c #硬鏈接文件test1.c
[[email protected] 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 看看

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

總而言之,Linux就是一個樹節點系統,由樹節點文件組成,操作一切文件都與樹的邏輯相同。

Copyright © Linux教程網 All Rights Reserved