Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make directory with leading hyphen

Tags:

unix

mkdir

Trying to mkdir with a leading hyphen in the name.

 mkdir -foo-
 mkdir '-foo-'
 mkdir `-foo-`
 mkdir `echo '-foo-'`

None of these work. Is there any way to do this?

like image 637
ted.strauss Avatar asked Dec 07 '22 04:12

ted.strauss


1 Answers

Try using -- to disable further option parsing:

mkdir -- -foo
like image 188
Alexander L. Belikoff Avatar answered Jan 12 '23 16:01

Alexander L. Belikoff