Article Title: differences between hard connection and soft connection in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
(1) Hard connection is not allowed across file systems (partitions) because different partitions have the same inode and hard connection characteristics and the file system is detachable )! Soft link has a complete pathname, so it can span across different file systems.
(2) hard connections do not produce new inode. No matter how many hard connections there are, they all point to the same inode node, but creating a new hard link will increase the number of node connections, as long as the number of connections at the node is not 0, the file will always exist, whether you delete the source file or the connected file. As long as one exists, the file exists (in fact, there are no source files connected, because they all point to the same inode node ). When you modify the source file or the connection file, other files are synchronized.
The soft link does not directly use the inode node number as the file pointer, but uses the file path name as the pointer. Therefore, deleting the connection file does not affect the source file. However, deleting the source file does not affect the file to be directed. Soft links have their own inode, and there is a small space on the disk to store the path name.
(3) A soft connection can be used to connect a non-existent file name.
(4) soft connections can be used to connect directories.
Ln-s source dist # establish a soft connection
Ln source dist # establish a hard connection