This question already has an answer here:
I have a script that creates files and sometimes they end up having 2 dashes at the beginning, is there any way to delete them mv doesn't work either
Here is the error I am getting
$ ls
--1355509766.jpg
$ rm --1355509766.jpg
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
$ rm "--1355509766.jpg"
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
The usual trick is
Update: here's what
man rm
has to say about this:Use
--
to separate options from parameters.This works with other commands too. For example:
Try file name with path:
Example: