Linux commands [8]:ln

Source: Internet
Author: User

Link command

link

ln-s [Original file] [target file]

Function: Generate link file

Options:

-S Create soft connection

The difference between soft links and hard links

Hard Links:

1, have the same I node (Inode) and storage block block, can be seen as the same file

2, can be identified by the I node

3. Cannot cross partition

4. Cannot be used for directory

Simply put: Because the node is the same, two files delete any one, the other can be used normally, that is, the system node is not deleted (of course, the reference to the file will be + 1)

Note: The hard-link file is the same size as the original file, but it does not occupy the actual memory

Soft Links:

1. Windows-like shortcuts

2, have their own I node and block blocks, but the data block only save the original file name and address, and there is no actual file data

3, lrwxrwxrwx l Soft link Soft link file permissions are rwxrwxrwx

Note: 777 permissions are only for linked files not for the original file

4, modify any file, the other changes

5, delete the original file, soft links can not be used

Simply put: The soft link is based on the original file, he will find the original file address and then according to the original file address to find the original file

Flexible and less restrictive than hard-link soft links More importantly, Ls-l will tell you that he is a link file and hard links can only be viewed through the I node.

Note: Because the soft link only saves the original file address, so when creating a soft link to suggest the original file to write absolute path, if you write relative path, then your link must be in the same directory as the original file can be used

Linux commands [8]:ln

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.