The difference between Linux soft link and hard link

Hard connection:
ln source_file dest_file

  1. The file has the same inode (index number) and data block (data block).
  2. Can only create existing files, not create directories
  3. Cannot be created across partitions
  4. Deleting a hard link will not affect other files with the same inode.
    Soft link
    ln -s source_file dest_file
  5. Soft links have their own file attributes and permissions
  6. Soft links can create non-existent files or directories
  7. Soft links can be created across partitions
  8. Create a soft link, the link count i_nlike will not increase
  9. Deleting a soft link does not affect the pointed file, but if the pointed source file is deleted, the related soft link becomes a dead link. If the pointed file is recreated, the dead link can restore the normal link.

Guess you like

Origin blog.51cto.com/13113400/2488498