Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Nice list. Just wanted to add that you can also break a relative path symlink by moving the symlink itself. Commented Oct 25, 2011 at 3:50
  • 5
    "[E]very directory entry is hard link." That's an excellent point that I've never seen expressed before, but I worry that someone just beginning to wrap his or head around links won't get it. For those in this situation, here's a hint: The layout of files and directories that you see when running the ls command isn't exactly the same thing as the storage system it represents. Hard links are references to an individual file on the storage system. A file is stored once. Read up on "inodes." Commented Jun 12, 2015 at 19:32
  • @Mario: yup. Every directory entry links a name to an inode. The system call for deleting a filename is even called unlink(2). "normal" files (with a link count of 1) are just a special case. If it helps, you can think of inodes as objects, and names as ref-counted pointers (the inode's link count is the reference-count). Commented Aug 29, 2015 at 22:53
  • 1
    You could think of a symbolic link as a text file with a name in it. It is interpreted as a symbolic link because of a special flag to the file. Hard link examples you know are .. and .. Commented Aug 30, 2015 at 13:28
  • 1
    here is another answer that explains why hard links can't be made to directories. I find this answer helpful because it is more concise and easier to read. Commented Dec 2, 2016 at 14:10