3 ms·
Actually, creating a hard link "ln" (no -s) would be the best choice. With the hard link, there are two directory entries pointing to the same data on the disk.
by gvb 6y ago
Actually, creating a hard link "ln" (no -s) would be the best choice. With the hard link, there are two directory entries pointing to the same data on the disk. At that point, removing the original with a "rm" unlinks the original but the new directory entry for the file remains.
As a bonus, ln will not overwrite the destination file if you mistakenly try to "ln" it to an existing file.
- pietrovismara 6y agoThanks for teaching me I can use "ln" without "-s". I used it for years and never thought about it.
- noisy_boy 6y agoTo best of my knowledge, hardlinks do not work across filesystems; softlinks do not have any such issues. Orphan links can be detected and cleared separately.