3 ms·
If it was a hard link to a directory, rm -r could've removed all the files from it first, before removing the directory itself. This would remove everything fro
by kolinko 4y ago
If it was a hard link to a directory, rm -r could've removed all the files from it first, before removing the directory itself. This would remove everything from the original dir.
(Or at least I think so - not a Linux expert here)
- ics 4y agoWhat system can you hardlink a directory? At least on macOS and FreeBSD the man pages explicitly state that hard links can only be created on files.
- toyg 4y agoI believe you can do it on Windows.
- cptparticles 4y agoWindows does not allow hardlinks to directories, but it does have the concept of junction points. https://learn.microsoft.com/en-us/sysinternals/downloads/junction https://learn.microsoft.com/en-us/sysinternals/downloads/jun...
- eyelidlessness 4y agoNit about macOS: HFS+ supports hard links to directories (added in 10.5 to support Time Machine), but APFS does not.
- ics 4y agoInteresting, thanks for the information. I had thought it was the same with HFS but guess it's been some time since I used it...