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
  •  | 
  •  

Вопрос

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?

Это было полезно?

Решение

Use -- to stop argument parsing.

$ cd -- -Tmp-
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top