Abstract
- It is like hyperlink on the webpage, that links up the components of File System
Hard File System Link
-
Pointing to Inode with data
-
Must be on the same File System
-
Space saving, we can have multiple references to a single set of data without duplicating the data
-
Like an additional name for an existing piece of data on disk. Deleting one hard link does not delete the data, as long as other links to that data remain
# Create a hard link to a file:
ln /path/to/file path/to/hardlink
- When we create a Hard link on Soft (Symbolic) File System Link, we create a direct link to the existing piece of data on disk, so independent of the soft file system link
Soft (Symbolic) File System Link
- Points to another File by Pathname
- The size is all about the length of the Pathname it stores in Inode
- Broken if the another File is broken
- Across different File System
# To create a symlink:
ln -s <source-location> <symlink-location>
# To symlink, while overwriting existing destination files
ln -sf <source-location> <symlink-location>
Dangling File System Link
- When Soft (Symbolic) points to an nonexistent file
Useful Commands
realpath
- Display the resolved Hard File System Link for a File or File Directory
realpath path/to/file_or_directory