Hard links and soft links

Source: Internet
Author: User
The links are divided into two types:
1, hard link, is a link through the index node. In the same partition/file system, the inode number of the same file must be a hard-link file, essentially the same file name is different; a hard-link file is another entrance to a file; You can prevent important files from being mistakenly deleted by setting a hard-link file to the file, only for files, not for directories.
The role of hard links: Make a snapshot of important files.

2, Soft link (soft link) or the link (symbolic link)
A symbolic link file is also known as a soft-link file, similar to a shortcut in Windows, which itself does not have content, pointing to the entity file, or a soft link to a file that can be true to the directory.

How to read data with soft links:
1, through its own inode, read the soft link information, by pointing to read the original file name, and then read the original files of the Inode
2, through the inode of the original file, read the contents of the original file (Block)

Create hard link syntax: ln raw File Destination file
Create soft link Syntax: Ln-s original file Destination file (the destination file cannot exist beforehand, the type of the soft link file is L "L")

[Email protected] gj]# Ll-hi
Total 8.0K
17243620-rw-r--r--. 2 root root 9 14:12 AA
17243620-rw-r--r--. 2 root root 9 14:12 aanew
Note: Hard links have the same index number

Hard links and soft links

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.