I just started learning about the Linux command line with the book "The Linux Command Line". I was trying to create a hard link by following instructions from the book and typing this command: ln fun fun-hard
. But I kept getting this result
ln: fun: hard link not allowed for directory
After doing some research, I found that hard links can't be created in directories. But if this is correct, why does the book include instructions for creating a hard link in a directory? Thanks for your help.
ls
output right after that.fun
is clearly supposed to be a file. In fact it looks likefun
was created a couple of sections previously by copying/etc/passwd
, another file. How did you end up withfun
as a directory following those instructions?