I don't know why someone would make a directory with a leading hyphen, e.g. named "-1". When I try to change to that directory, it says invalid option.
I tried putting "-1" in quotes but that didn't help either. Can anyone tell me how to access these types of dirs?
$ ls -l
total 3
lrwxrwxrwx 1 root root 2 Dec 7 18:51 lastFailedBuild -> -1
lrwxrwxrwx 1 root root 2 Dec 7 18:51 lastUnstableBuild -> -1
lrwxrwxrwx 1 root root 2 Dec 7 18:51 lastUnsuccessfulBuild -> -1
$ cd -1
-bash: cd: -1: invalid option
cd: usage: cd [-L|[-P [-e]] [-@]] [dir]
$
--
to delimit options and arguments, i.e.cd -- -1
could have worked if it had existed. – Artem S. Tashkinov Jan 26 '23 at 22:28