Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mac osx: how to cd to the folder with a name which the first character is "-"?

Tags:

macos

cd

There is a foler which name is "-Tmp-", how can I cd into it?

When I use cd, it prompt as:

$ cd -Tmp-/
cd: -T: invalid options

Anybody can help me?

like image 559
Gate Luma Avatar asked Nov 24 '25 02:11

Gate Luma


1 Answers

Use -- to stop argument parsing.

$ cd -- -Tmp-
like image 87
trojanfoe Avatar answered Nov 26 '25 17:11

trojanfoe