If you’ll ever have a situation that you need to enter into a directory with a name like “-test” or any other starting with “-“, this is a post for you.
Solution: You need to use — argument.
So, one way to do this is:
cd -- -test
Other way to do this is to specify the path explicitly:
cd ./-test
Btw, if you would like to delete a directory called like this, you should do next:
rm -r -- -test
If you liked the post, we should get connected - follow me on Twitter