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
1 comments:
The post is written in very a good manner and it entails many useful information for me. I appreciated what you have done here. I am always searching for informative information like this. Thanks for sharing with us.
Renew SSL
Post a Comment