Hard Link features :
Because a hard link is a file with the same inode number with only a different file name, there are several characteristics of hard links:
1. The file has the same inode and DataBlock
2. Only files that already exist can be created
3. You cannot create a hard link on a cross-file system, only in the same file system
4. You cannot create a directory, only the file can be created
5. Deleting a hard-link file does not affect other files that have the same inode number
Soft Link Features:
A soft connection differs from a hard link in that the file is a soft connection if the contents of the file's user data block are directed to the path of another file. In fact, the content of the soft connection is the path character of the linked file, so that the soft link has its own inode number and data block, so the creation and use of soft links is not a lot like hard link restrictions.
So it has the following characteristics
1. Soft links have their own file attributes and content
2. Soft links can be created on a cross-file system
3. Soft connection to create files and directories
4. Create a soft connection, the number of links in the source file does not increase
5. Can be created for empty files and empty directories
command to use : Ln-s + path to soft connection + Soft connection file name
ln + can be a path relative to a hard link, or it can be relative to the current directory path + hard-Link file name
Summary differences:
1. Hard link Original file/link file common an inode number, stating that they are the same file, and the soft link original file/link file has a different inode number, indicating that they are two different files;
2. The soft link in the file attribute explicitly writes out is the link file, and the hard link is not written out, because in essence the hard link file and the original file is completely equal relationship;
3. The number of links is not the same, the number of links to soft links will not increase;
4. File size is not the same, hard-link file display size is the same as the original file. The size of the soft link shown here is different from the original file.
5. because the link file contains the path information of the original file, so when the original file moved from one directory to another directory, and then access the linked file, the system will not be found, and the hard link does not have this flaw, you want to move how to move And it wants the system to allocate additional space for creating a new index node and saving the path to the original file.
This article is from the "14545" blog, please be sure to keep this source http://10793128.blog.51cto.com/10783128/1833916
Hard links differ from soft links