You don't typically create files with names like this but they can arise through errors such as cut and pasting text into your command line.
Simply escaping the character or quoting the filename does not work.
The solution is to use a longer path to the file - the easiest being a relative path to the same directory.
If the filename is '--myfile' you will get an error like this:
$ ls --myfile
ls: illegal option -- -
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
But this works just fine:
$ ls ./--myfile
./--myfile
No comments:
Post a Comment