Interview Prep/Linux/Filesystem Hierarchy, Inodes & Links

Compare hard links and soft links.

IntermediateConceptFilesystem Hierarchy, Inodes & Links
Answer
Hard link Soft link
Points to inode path
Cross filesystems No Yes
Link to directory No (except . and ..) Yes
Target deleted Data survives Link breaks
Own inode No Yes

In production we use symlinks for release switching (current -> releases/v42) because the swap is atomic with ln -sfn.

All Linux questions Roadmap: Linux

More on Filesystem Hierarchy, Inodes & Links