-1

I accidentally created a file when I meant to pass an option. Now I have a file named: -myfile that I can not delete with rm -myfile

$ touch hi > -myfile
$ rm -myfile

rm: invalid option -- 'm'
Try 'rm ./-myfile' to remove the file ‘-myfile’.
Try 'rm --help' for more information.
tarabyte
  • 4,296
  • 1
    This question is quite funny; since the posted error message already suggests one way to remove that file. – Janis Jun 06 '15 at 08:15

1 Answers1

4

This is simple, these are the two most common ways:

rm ./-yourfile

or

rm -- -yourfile

Marcelo
  • 3,561