I can do (say)
cd ... to go back 2 directories but
... is not listed in the output if I do
ls -a. So how does linux understand that I want to go up 2 parent directories? I understand that
.. are like hard links to the current and parent directory.
Answering my own question as my initial question itself was flawed
Linux doesn't actually understand multiple periods. It's actually
zsh which interprets it as going up multiple parent directories.
So if you are using
zsh and are on say
/a/b/c and use the command
cd ..., it will take you back to
/a. If you are using bash, it will correctly tell you that no such file or directory exists. It works the same way for other commands such as
ls so you can actually do
ls ... to see the files in the parent's parent directory. Just keep adding periods to go up one more parent.
It's a neat little feature hidden in zsh that I didn't know earlier. Thanks for the help everyone :)