$ echo "hi" > -oops.txt
$ rm -oops.txt
$ rm \-oops.txt
$ rm "-oops.txt"
rm: invalid option -- 'o'
Try `rm ./-oops.txt' to remove the file `-oops.txt'.
Try `rm --help' for more information.
$ rm ./-oops.txt
Designing and Building Exceptional Web Apps
$ echo "hi" > -oops.txt
$ rm -oops.txt
$ rm \-oops.txt
$ rm "-oops.txt"
rm: invalid option -- 'o'
Try `rm ./-oops.txt' to remove the file `-oops.txt'.
Try `rm --help' for more information.
$ rm ./-oops.txt
You can also use the double-dash to indicate that no more options should follow:
ReplyDeleterm -- -oops.txt
That's actually the gnu rm command giving you the suggestion: http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/rm.c#n104
ReplyDelete