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

StackOverflow https://stackoverflow.com/questions/19708840

  •  02-07-2022
  •  | 
  •  

Pergunta

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?

Foi útil?

Solução

Use -- to stop argument parsing.

$ cd -- -Tmp-
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top