Linux----hard and soft connections

Source: Internet
Author: User
One, the concept

In a Linux file system, files stored in a disk partition, regardless of type, are assigned a number called the index node number (Inode index).

  • Hard Links
    1. Multiple file names point to the same index node (multiple copies of a file)

    2. Allows a file to have multiple valid paths, and users can create hard links to important files to prevent "accidental deletion" of the disaster.

    3. If a file has a hard link, the file deletion condition is (all the hard links associated with it are deleted)

  • Soft connection
    1. Soft joins are also known as symbolic links, similar to Windows shortcuts

    2. In a symbolic link, a file is a text file that contains the location information of another file

Second, the experiment

    • Hard links from which you can find F2 are F1 (the same index node number)
    • F3 is a soft connection of F1
    • Hard links are not affected and soft connections are invalid when the original file F1 is deleted
Three, summary
  1. Hard-link files are not affected after the original file is deleted, and the soft connection file fails
  2. Delete hard-link files, both original and soft connection files are unaffected
  3. Delete Soft connection file, original file and hard link file are unaffected
  4. Delete the original file and the hard link file, the file is really deleted

Linux----hard and soft connections

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.