toughy problem? for you gurus, cannot delete a weird named file

Somehow I ended up with a file of this name.

-rw-r--r--.xml

I cannot do anything to it, rename or delete it, even doing something like rm *.xml.

This error is generated.

Code:
rm: illegal option -- w
usage: rm [-f | -i] [-dIPRrvW] file ...
       unlink file

any ideas would help a lot thanks.
 
I prefer $ rm ./-rw-r--r--.xml, this works on every unixoid system (the -- variant does not). mix_room's and SirDice's solutions will not work at all, because rm still sees the first argument beginning with a dash.
 
Oh, right. That's because the shell expands the wildcards first, before executing the command :r
 
Just in case you were wondering: from rm(1):
Code:
NOTES
     The rm command uses getopt(3) to parse its arguments, which allows it to
     accept the `--' option which will cause it to stop processing flag
     options at that point.  This will allow the removal of file names that
     begin with a dash (`-').  For example:

           rm -- -filename

     The same behavior can be obtained by using an absolute or relative path
     reference.  For example:

           rm /home/user/-filename
           rm ./-filename
 
Back
Top