HACKER Q&A
📣 oweiler

Why is CD.. in the root directory not an error?


The title says it all. Why is the resulting status code 0?

$ cd / $ cd .. $ echo $? # is 0, but shouldn't that be 1?


  👤 josephcsible Accepted Answer ✓
If ".." didn't exist in the root directory, then it would be an error. But it does exist, and it just points back at itself like "." does.