1. Create multiple entries or access points for the same file.
1) hard link: both the original file name and the connection file name point to the same physical address, that is, the original file and the hard connection file are the same file (not a copy ), the two files occupy the same index point (equivalent to the reference count plus 1 ). After a hard connection is created for the file, the number of connections to the file is increased by 1. The directory cannot have a hard link. Cross-file system is not supported.
Hard connection refers to the connection through the index node. The role is to allow a file to have multiple valid path names.
2) Symbolic connection
The number of connections does not increase, which is equivalent to the shortcut in windows. Occupies an index node.
Ls-I [file path]
Ln-[f/S] [Existing file path name] [link file path]
-F remove existing destination files
-S make symbolic links instead of hard links
2. Example
1) hard link
-RW-r -- 2 root Root 22 Sep 28 05:08 Test
-RW-r -- 2 root Root 22 Sep 28 05:08 test1
Lrwxrwxrwx 1 Root 4 Sep 28 05:08 Test2-> Test
Ls-I, same inode
Ll View
Generate a symbolic link: ZZ
Ln-s YY ZZ
Generate a hard link: ZZ
Ln YY xx
Reference
[1] http://linux.chinaunix.net/man/2004-10-06/45.shtml
Http://space.itpub.net/519536/viewspace-591175