Soft and hard connections in Linux

Source: Internet
Author: User

1. How to create a soft connection

LN -s/path/to/original/path/to/linkname

When we make changes to the soft connection file, the corresponding changes are also reflected in the original file (and vice versa).

When we delete a soft connection file, the original file does not make any changes.

When we delete the original file, the soft connection file still exists, but it points to a nonexistent file, a soft connection called a hanging connection.

2. How to Hard Connect software

Ln /path/to/original. file /path/to/link. file

3. The difference between soft and hard connections

Hard Connect:

    1. You can only connect to a file, not a directory.
    2. Cannot connect to a file, this file is on a different disk/volume.
    3. Although the file is moved, you can still connect to the file.
    4. The connection references the physical address on the hard disk.

Soft connection:

    1. Can be connected to a directory.
    2. Can connect files or directories, this file or directory in different hard disk/volume.
    3. If the original file is deleted, the connection still exists.
    4. If the original file is moved, the connection will not be able to reference the file.
    5. The connection references the abstract file name/directory, not the physical address. They have their own nodes.

Reference URL:

    1. https://www.nixtutor.com/freebsd/understanding-symbolic-links/

Soft and hard connections in Linux

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.