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 . and .. are like hard links to the current and parent directory.

  • 1
    Where are you getting that cd ... works? This doesn't work by default, only . and .. are accepted 'shortcuts' unless you have some special scripts or such set up...
    – Thomas Ward
    Mar 20, 2019 at 16:58
  • 1
    That may be an alias or a function, please edit and provide the relevant lines from your dotfiles, you can find them with e.g.: grep '\.\.\.' ~/.bashrc ~/.bash_aliases ~/.bash_functions
    – dessert
    Mar 20, 2019 at 17:01
  • 1
    ... or the OP is using zsh maybe? Mar 20, 2019 at 17:03
  • @steeldriver I am actually using zsh, I didn't know this works only in zsh Mar 20, 2019 at 17:05
  • 2
    @dessert I had to do a bit of rootling around, but it seems like they are aliases even in zsh (provided by .oh-my-zsh/lib/directories.zsh) - at least, that is the case on my system Mar 20, 2019 at 17:16

1 Answer 1


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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.