Soft links and hard links under Linux

Source: Internet
Author: User

Hard Links

You can delete any one of the two files without being affected by a file alias.

Directory cannot be a hard link to a directory

You can only do hard links under the same partition, not across partitions

How to use:

Ln-i/root/1.txt/tmp/2.txt (A hard link to 1.txt under root, connected to 2.txt under TMP)



Soft links

Equivalent to a shortcut on the desktop

Soft links can be made across partitions

Files can be soft links, directories can also do soft links

How to use:

Ln-s/root/12.txt/tmp/23.txt (a soft link to the 12.txt file under root, linked to the 23.txt under TMP)

Attention:

Soft links can be soft links, but after removing the middle soft link, the last soft link is not available


Soft links and hard links under Linux

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.