Linux Foundation Certified System Administrator (LFCS) — Question 125
After successfully creating a hard link called bar to the ordinary file foo, foo is deleted from the filesystem. Which of the following describes the resulting situation?
Answer options
- A. foo and bar would both be removed.
- B. foo would be removed while bar would remain accessible.
- C. foo would be removed. bar would still exist but would be unusable.
- D. Both foo and bar would remain accessible.
- E. The user is prompted whether bar should be removed, too.
Correct answer: B
Explanation
When a hard link is created, both the original file and the link point to the same inode. Deleting the original file (foo) does not affect the link (bar), which will still provide access to the data. Therefore, option B is correct as foo is deleted but bar remains accessible.