One, the concept
In a Linux file system, files stored in a disk partition, regardless of type, are assigned a number called the index node number (Inode index).
- Hard Links
Multiple file names point to the same index node (multiple copies of a file)
Allows a file to have multiple valid paths, and users can create hard links to important files to prevent "accidental deletion" of the disaster.
If a file has a hard link, the file deletion condition is (all the hard links associated with it are deleted)
- Soft connection
Soft joins are also known as symbolic links, similar to Windows shortcuts
In a symbolic link, a file is a text file that contains the location information of another file
Second, the experiment
- Hard links from which you can find F2 are F1 (the same index node number)
- F3 is a soft connection of F1
- Hard links are not affected and soft connections are invalid when the original file F1 is deleted
Three, summary
- Hard-link files are not affected after the original file is deleted, and the soft connection file fails
- Delete hard-link files, both original and soft connection files are unaffected
- Delete Soft connection file, original file and hard link file are unaffected
- Delete the original file and the hard link file, the file is really deleted
Linux----hard and soft connections