This page on inodes has been exceptional help in grasping the surface-level concept of file systems. On the same page, the author has inserted this snippet demonstrating that each file or directory has at least 2 names (and hard links):
/tmp/junk$ ls -id .. 327681 .. /tmp/junk$ cd .. /tmp$ ls -id . 327681 .
We can see that
/tmp has 3 hard links:
- Presumably, an inode for the filename “tmp”
- The same inode for the name “..”
- The same inode for the name “.”
My question: can the “junk” file in the
/tmp directory also have 3 names (and hard links) if it is given a child directory? For example,
My hypothesis: If the “junk” file becomes a parent, it can be invoked with
.. but relatively, meaning the current working directory (from which
.. is typed) would have to be within the directory path
/tmp/. The answer to my question is probably too advanced.