Earlier quoted context omitted.
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)
What 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.
Difference Between a Symbolic Link and a Hard Link
11–15 of 15 posts
Re: Difference Between a Symbolic Link and a Hard Link
#12Earlier quoted context omitted.
What 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.
I believe you can do it on Windows.
https://learn.microsoft.com/en-us/sysinternals/downloads/jun...
Re: Difference Between a Symbolic Link and a Hard Link
#13Earlier quoted context omitted.
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)
What 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.
Re: Difference Between a Symbolic Link and a Hard Link
#14What made it click for me mentally was this thought: there's no such thing as a hard link . Or alternatively, every file is a hard link . Files don't have names. At least, they don't have names for themselves. Instead, they have unique ids (i-node numbers). But obviously we use names for files, which happens because a directory can give a name to a file. However, the name is just that directory's name for the file. T…
I came to that realization when I needed to delete a file and the function call to use was named `unlink`.
Re: Difference Between a Symbolic Link and a Hard Link
#15Earlier quoted context omitted.
What 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.
Nit about macOS: HFS+ supports hard links to directories (added in 10.5 to support Time Machine), but APFS does not.