F
F
friden_craw2022-02-04 23:14:37
linux
friden_craw, 2022-02-04 23:14:37

Why are hard links a bad option to protect a file from deletion?

I came across the statement that creating a hard link to a file is such a way to protect it from deletion. But as long as there is a hard link, the content will remain. Why is hardlink protection a bad way? Because of the names?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Volkov, 2022-02-04
@friden_craw

It will only "protect" the content from unlink (rm). But it won't protect against overwriting at all, like:
echo > file
Even if you have the contents of the file aside, there is no information about the original name and position.
Make a backup.

D
Drno, 2022-02-04
@Drno

because the original file will be deleted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question