1, Linux files occupy a inode,inode point to the file content.
2. The file name can be considered as a pointer to the inode. A hard connection is equivalent to a whole copy of the pointer, not a copy of the file's contents. Two file names (two pointers) can modify the file, delete one does not affect the other, as follows:
[[email protected] home]# Touch AAA
[email protected] home]# cat >AAA
Hello
[[Email protected] home]# LN AAA AAA.HL
[email protected] home]# cat >>AAA.HL
World
[[email protected] home]# more AAA
Hello
World
[[email protected] home]# rm-f AAA
[Email protected] home]# more AAA.HL
Hello
World
3, the soft connection is equivalent to the pointer reference, delete the pointer, the reference is also invalid.
[[email protected] home]# Touch AAA
[email protected] home]# cat >AAA
Hello
[Email protected] home]# ln-s AAA AAA.SL
[email protected] home]# cat >>AAA.SL
World
[[email protected] home]# more AAA
Hello
World
[[email protected] home]# rm-f AAA
[Email protected] home]# more AAA.SL
Aaa.sl:No such file or directory
Linux hard connect and soft connect