How to `cd` into directory with the name `-`? [closed] How to `cd` into directory with the name `-`? [closed] bash bash

How to `cd` into directory with the name `-`? [closed]


use instead

cd ./-

if you are in the directory above.


or like this:

cd -- -/

Adding a / at the end of a file name ensures that the file is treated as a directory.


cd -- ./-should do the trick :)

It treats everything after the -- as not a command.