Wednesday, April 6, 2011

Create files with a leading dash "-" in Linux/Unix

If you happen to need a file created with a leading dash "-" all you have to do is add the double "--" and the "-"  

Example:  touch -- -thisfile  

The concept is pretty much the same as on how you would delete,move,edit files with a leading dash.

Example:  rm -- -thisfile
                 mv -- -thisfile
                 vi -- -thisfile

This is handy if for example you have sites that needs id verification from site rating providers etc. 

It's one of those days when you really need to get things done immediately but you have to browse the Internet for some answers.  Cheers!

1 comment: