Establish a Hard link command: ln src-link dest-link
Establish a soft link: ln-s src-link dest-link 1. Hard links are aliases, and soft links are shortcut 2. Hard links and source links point to the same I node, soft links are different 3. Hard links cannot span file systems, and soft links can be 4. Deleting both hard and soft links does not affect the original link 5. Hard links can only be for files, soft links for files and directories
6. Questions about the I node. Hard connections No matter how many, all point to the same I node, will increase the number of node connections, as long as the junction number of connections is not 0, the file exists, regardless of whether you delete the source file or the connected file. As long as there is one exists, the file exists (in fact, it does not divide the source file connection files, because they point to the same I node). When you modify the source file or any one of the connection files, the other files will be changed synchronously. Soft links do not use the I node number directly as a file pointer, but instead use the file path masterpiece as a pointer. Therefore, deleting a connection file has no effect on the source file, but deleting the source file will cause the connection file to be unable to find the file to point to. The soft link has its own inode, and there is a small space on the disk to store the path name.
Note: I node: it is a data structure used internally by UNIX to describe the characteristics of a file. We usually call the I node the file index node (information node). The I node contains important information about most of the file, including the address of the file data block on disk. Each I node has its own flag number, which we call the file sequence number. I node contains information 1. file type 2. File is the main relationship 3. Access to files 4. The time of the file is truncated.
The difference between hard and soft links in a Linux file system (RPM)