Hard connection:
ln source_file dest_file
- The file has the same inode (index number) and data block (data block).
- Can only create existing files, not create directories
- Cannot be created across partitions
- Deleting a hard link will not affect other files with the same inode.
Soft link
ln -s source_file dest_file - Soft links have their own file attributes and permissions
- Soft links can create non-existent files or directories
- Soft links can be created across partitions
- Create a soft link, the link count i_nlike will not increase
- 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.