Linux索引节点及值

<

div id=”content” contentScore=”1088″>Linux索引节点及值(弄清十分必要)。

各位看官,

[root@www.linuxdc.com aaa]# ls -l test.c

-rw-r–r–. 1 root root 3 Aug 1 07:49 test.c #看加粗1 原始test.c文件索引节点值为1,也就是每个文件第一次生成时候都是唯一的1值
[root@www.linuxdc.com aaa]# ln test.c test1.c #硬链接文件test1.c
[root@www.linuxdc.com 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@www.linuxdc.com aaa]# rm -rf test.c
[root@www.linuxdc.com aaa]# ls -li test*
262594 -rw-r–r–. 1 root root 3 Aug 1 07:49 test1.c #变回来了吧,注意很多资料说这个值不变,还是2,是错误的。

总而言之,Linux就是一个树节点系统,由树节点文件组成,操作一切文件都与树的逻辑盼/div>