I was reading up on similar questions on here about what happens when you delete a hardlink to a file and the majority of the answers I was getting were that the hardlink is deleted but the original stays. However during my testing, if I have
FileA.txt
and LinkFileA.txt
both in separate directories, if I rm -rfv
the directory that contains LinkFileA.txt
, it also goes and deletes the original. Example:
home/testing/dira/FileA.txt
home/testing/dirb/LinkFileA.txt
rm -rfv home/testing/dirb/*
deletes both the file in dirb
and the file in dira
.
Why is this?
rm -rfv
? I'm rather surprised by the behaviour you're seeing...