Skip to main content
clarified the significance of both inode values being the same
Source Link
Warren Young
  • 73.5k
  • 17
  • 182
  • 172

/.. points to /:

$ ls -id / 2 / $ ls -id /.. 2 /.. 

On this system, bothBoth have the same inode number, which happens to be 2 on this system. (The exact value doesn't matter.)

It's done for consistency. This way, there doesn't have to be code in the kernel to check where it currently is when it processes a .. in a path. You can say cd .. forever, and never go deeper than the root.

/.. points to /:

$ ls -id / 2 / $ ls -id /.. 2 /.. 

On this system, both have the same inode number, 2.

It's done for consistency. This way, there doesn't have to be code in the kernel to check where it currently is when it processes a .. in a path. You can say cd .. forever, and never go deeper than the root.

/.. points to /:

$ ls -id / 2 / $ ls -id /.. 2 /.. 

Both have the same inode number, which happens to be 2 on this system. (The exact value doesn't matter.)

It's done for consistency. This way, there doesn't have to be code in the kernel to check where it currently is when it processes a .. in a path. You can say cd .. forever, and never go deeper than the root.

Source Link
Warren Young
  • 73.5k
  • 17
  • 182
  • 172

/.. points to /:

$ ls -id / 2 / $ ls -id /.. 2 /.. 

On this system, both have the same inode number, 2.

It's done for consistency. This way, there doesn't have to be code in the kernel to check where it currently is when it processes a .. in a path. You can say cd .. forever, and never go deeper than the root.