Hard links and soft links used, and differences

Source: Internet
Author: User

Hard Links: Link

Popular understanding: multiple names from a file

Features: ln (link) the original and destination files are not in a directory

Delete a file and another file can also use the

multiple hard links occupy only one copy of the data space

no cross-section, cross-device

hard links cannot be created for a catalog.

Common Hard-link methods:

ln Raw File Link file

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/85/2B/wKiom1ebVuzQ8RkNAAA5xDvUZ-4814.png "title=" 3.png " alt= "Wkiom1ebvuzq8rknaaa5xdvuz-4814.png"/>


Number of file connections: equivalent to the number of names of a file, no increase in the number of hard-link connections increased by 1

the number of links to the directory: each directory . total number of files, including sub-file


RM Deleting a hard-link file is equivalent to deleting the file name.


Soft Links:

Popular saying: Quite a shortcut

Attribute: Soft link size equals link filename character number

Create multiple files without changing the number of connections

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/85/2B/wKiom1ebWMfQuLJNAAAujARhZg0078.png "title=" Qq20160729212304.png "alt=" Wkiom1ebwmfquljnaaaujarhzg0078.png "/>

Can cross device, create link is best write absolute path

Can be soft-linked to a directory

How to create a soft connection

Ln–s original file relative path or absolute path (must be relative to soft link path) Soft Link File

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/85/2B/wKioL1ebWZyQ2y1iAAAoRhdhLMM964.png "title=" Qq20160729212624.png "alt=" Wkiol1ebwzyq2y1iaaaorhdhlmm964.png "/>

The following command causes the error:


The/testdir/f1 file is hard-linked to/testdir/aa/f2, and relative paths are used in the original file, where the relative path is relative to AA, not the previous layer of TESTDIR/,AA, testdir,f2 the actual link testdir/ Testdir/f1

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/85/2B/wKiom1ebWq_A4DAMAACOGanE6oE469.jpg "title=" 1.jpg " alt= "Wkiom1ebwq_a4damaacogane6oe469.jpg"/>







Hard links and soft links used, and differences

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.