Tags: des strong file Ar linux on window C
There are two types of links in Linux: Hard links and soft links (soft link), and soft links called Symbolic links (symbolic link)
To create a command:
Ln-s Softlink destfile/directory #建立软连接
ln hardlink destfile #建立硬连接
In a Linux system, the kernel allocates an inode for each newly created file, each with a unique inode number, and we can simply interpret the inode as a pointer that will always point to the specific storage location of the file. File attributes are stored in the inode, and when the file is accessed, the inode is copied to the inside to enable quick access to the file. The system locates each file through an inode.
A hard link is actually a pointer to the inode of the source file, and the system does not redistribute the inode for it. Hard connections do not build new inode, hard connections No matter how many, are pointing to the same inode node, but the new one will increase the number of node connections, as long as the node connection number is not 0, the file exists, regardless of whether you delete the source files or connected files. As long as there is a existence, the file exists (in fact, the concept of reference counting). When you modify the source file or any one of the connection files, the other files will be changed synchronously.
Soft links (soft link)
Soft links The most intuitive explanation: equivalent to the Windows system shortcut, is a separate file (has a separate inode, regardless of the source file inode), the content of the file is the source file path pointer, through the link can access to the source file. So delete the soft link file has no effect on the source file, but delete the source file, the soft link file will not find the file to point to (You can analogy Windows shortcut, you click the shortcut can access a file, but delete the shortcut, no effect on the source file).