What will happen when create a hard link and delete the text file?
Answers
Answered by
0
Explanation:
In Unix all normal files are Hardlinks. Hardlinks in a Unix (and most (all?)) filesystems are references to what's called an inode. The inode has a reference counter, when you have one "link" to the file (which is the normal modus operandi) the counter is 1. When you create a second, third, fourth, etc link, the counter is incremented (increased) each time by one. When you delete (rm) a link the counter is decremented (reduced) by one. If the link counter reaches 0 the filesystem removes the inode and marks the space as available for use.
In short, as long as you do not delete the last link the file will remain.
HOPE IT'LL HELPFUL FOR YOU
Similar questions