Differences between hard connection and soft connection in Linux

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.