In a Linux system, the kernel allocates an Inode (index node) for each newly created file, each with a unique inode number. The file attributes are stored in the index node, and the index nodes are copied to the file when they are accessed, enabling quick access to the file.
A link is a way to establish a connection between a shared file and a number of directory entries for the user who accesses it.
Two types of links:
1. Hard link
2. Soft link (Soft link) or symbolic link (symbolic link) is equivalent to a shortcut under Windows
*********************************************************************************
Ln-s Source Dist # establishing a soft connection
ln Source Dist # to establish a hard connection
*********************************************************************************
1. Soft link is actually just a paragraph of text, pointing to the original file path information , can be any file or directory , can link different file system files
even , which produces a "broken chain" problem (or "phenomenon")!
2. When the symbol file is read or write operation, the system will automatically convert the Operation to the source file, but when deleting the linked file , the system simply deletes the linked file, not the source file itself.
Use the Ln-s command to generate a soft connection, as follows:
[[email protected] test]# ln-s source_file softlink_file
*********************************************************************************
A hard connection takes up the same amount of space and changes one of the two, and the same change happens to the other.
1. Hard connections must be in the same file system , and soft connections can cross file systems
2. do not allow the creation of hard links to the directory
This article is from the Linux Operations sharing blog, so be sure to keep this source http://liangey.blog.51cto.com/9097868/1572184
The difference between hard links and soft links in Linux