The way that files are organized under Linux is that each file occupies a file in a Inode,inode, block information, etc., can be understood as index file system, through Inode index to the corresponding block, that is, read the file.
Hard Link
Hard link is actually multiple files connected to the same inode, so the information for these two files is almost identical, hard link has the following features:
1) You delete any one of the two, the file will not be deleted, you can still read the file data through another file name;
2) Modify the file data by any file name is the same result;
3) Different file system files can be organized differently, so hard link can only be done on a single file system;
4) cannot connect to the directory, if you use hard link to connect to the directory, the connected data need to be connected with all the data under the directory to establish a connection, the complexity is quite large.
5) '. ', '. ' It's all hard link.
Symbolic link
Symbolic link and Windows shortcuts can be equated, symbolic link is essentially to create a separate file, it will occupy the inode and block, but this file will let the data read to its connected file name.
1) If the original file is deleted, the connection file will not be opened;
2) Symbolic link can be connected to different file systems, can also be connected to the directory;
As a result, symbolic link is used more widely than hard link.
Command
ln [-SF] source file destination file
Hard link does not add the s parameter, otherwise the symbolic link,f parameter indicates coercion, and if the destination file exists, the target file is deleted and recreated.
Hard link differs from symbolic link