Soft links and hard links in Linux

Source: Internet
Author: User

Soft links and hard links in Linux

What is a linked file?

1, Hard link: Multiple files point to the same inode with different paths to each other as hard links.

2, Soft Link: (Memory size is a string unit)

the Inode has no data, just stores a path string and finds the path to the file.

* the number of hard links, less than or equal to 1 , files can be completely deleted

file is not easy to delete when greater than 1

ln [-s-v] SRC DEST

-S Create soft links

-V Show creation process

No option means to create a hard link

Create a hard link

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7E/68/wKioL1b-TZXwuVfzAAJ6RySN4-c594.jpg "title=" 143534.JPG "alt=" Wkiol1b-tzxwuvfzaaj6rysn4-c594.jpg "/>

ABC is the same as the inode number of the DEF after the link is created .

Create a soft link

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7E/68/wKioL1b-TbyQjxXOAAIcKTZrxVs136.jpg "title=" 234. JPG "alt=" Wkiol1b-tbyqjxxoaaicktzrxvs136.jpg "/>

Summarize

Hard Links:

1. can only be created on files, cannot be applied to the directory

2. cannot be implemented across file systems

3. Creating a hard link increases the number of times a file is linked

Symbolic links (Soft links)

1. can be applied to the directory

2. can cross file system

3. do not increase the number of links to linked files

4. its size is the number of characters that the specified path contains


Soft links and hard links in 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.