Hard link differs from symbolic link

Source: Internet
Author: User

The way that files are organized under Linux is that each file occupies a file in a Inode,inode, block information, etc., can be understood as index file system, through Inode index to the corresponding block, that is, read the file.

Hard Link

Hard link is actually multiple files connected to the same inode, so the information for these two files is almost identical, hard link has the following features:

1) You delete any one of the two, the file will not be deleted, you can still read the file data through another file name;

2) Modify the file data by any file name is the same result;

3) Different file system files can be organized differently, so hard link can only be done on a single file system;

4) cannot connect to the directory, if you use hard link to connect to the directory, the connected data need to be connected with all the data under the directory to establish a connection, the complexity is quite large.

5) '. ', '. ' It's all hard link.

Symbolic link

Symbolic link and Windows shortcuts can be equated, symbolic link is essentially to create a separate file, it will occupy the inode and block, but this file will let the data read to its connected file name.

1) If the original file is deleted, the connection file will not be opened;

2) Symbolic link can be connected to different file systems, can also be connected to the directory;

As a result, symbolic link is used more widely than hard link.

Command

ln [-SF] source file destination file

Hard link does not add the s parameter, otherwise the symbolic link,f parameter indicates coercion, and if the destination file exists, the target file is deleted and recreated.

Hard link differs from symbolic link

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.