2.7 Links
Links allow you to have multiple references to a single file.
Inodes
Section titled “Inodes”Every file in a filesystem is identified by an inode (index node), which stores metadata (permissions, owner, size, disk location) but not the filename. Directories map filenames to inodes.
Types of Links
Section titled “Types of Links”1. Hard Links
Section titled “1. Hard Links”A hard link is just another name for the existing file. Both names point to the same inode.
-
Properties:
- Must be on the same filesystem.
- Cannot link to directories.
- Deleting the original name does not delete the data (as long as one link remains).
-
Command:
2. Symbolic Links (Soft Links)
Section titled “2. Symbolic Links (Soft Links)”A symbolic link is a special file that points to the path of another file. It’s like a shortcut in Windows.
-
Properties:
- Can span distinct filesystems.
- Can link to directories.
- If the original is deleted, the link becomes broken.
-
Command: