This question already has an answer here:
When we create a directory in UNIX it has 2 hard links:
One to itself and another one to its parent directory.
As I read the
. increases counter of the directory, and the
.. increases hard links counter of parent directory.
. is counted in the directory, but there are still 2 hard links when I do
What is the second one?
Can someone tell me how hard links are counted in directories?
Imagine, we have this hierachy:
parent - 4 hard links . . child_1 - 2 hard links . . child_2 - 2 hard links