Hard link soft link

Source: Internet
Author: User
Hard Link
[Oracle @ DCM ~] $ Ln original. File hard. Link

Soft link
[Oracle @ DCM ~] $ Ln-SOriginal. File soft. Link

[Oracle @ DCM ~] $ LS-l
-RW-r -- 2 Oracle oinstall 4 Jul 14 17:21 Original. File
-RW-r -- 2 Oracle oinstall 4 Jul 14 :21 hard. Link
Lrwxrwxrwx 1 Oracle oinstall 13 Jul 14 17: 23 soft. Link-> original. File

The number of links is only a concept related to hard links.
You can track soft links from linked files (reverse tracing is not supported)

---------------
Because the file system structure such as inode is not bidirectional, you cannot find how many times an inode has been referenced. We can only use some techniques to track hard links.
1. Through the number of links, we can know which file has a hard link (greater than 1)
2. Find the inode ID of the file.
[Oracle @ DCM ~] $ LS-I hard. Link
1573158 hard. Link
3. Search for files by inode ID (if you need to traverse a large number of directories, the speed can be imagined)
[Oracle @ DCM ~] $ Find-inum1573158
./Hard. Link
./Original. File
4. Hard links are essentially multiple dentry pointing to the same inode, so there is no distinction between master and slave, and each dentry is equal.

Find all files with hard links greater than 2 in the system: # fin D/ -LI NKS + 2-type F

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.