There are two types of link.
Another directory entry for an existing file. The directory entries have different names but point to the same inode (same data and file properties).
When deleting a hard link only the inode reference to it is deleted/decremented. The original file is only deleted when the inode link count = 0. When creating a hard link the target must exist.
- Hard links can only be created in the same filesystem since they all use the same inode.
- Hard links cannot point to directories.
Symbolic or Soft Link
Is a pointer to another file. This file can be local, remote or on another filesystem.
Can point to a non-existent file in which case they are known as broken or stale links.
Deleting a soft link deletes the link, the original/physical file remains untouched.
A link itself has no file permissions, the permissions of the file it points to are used.