Quoting Timothy Murphy (tim at birdsnest.maths.tcd.ie):
> How do I delete this file, called "-1234" ?
UNIX FAQ question 2.1:
2.1) How do I remove a file whose name begins with a "-" ?
Figure out some way to name the file so that it doesn't begin
with a dash. The simplest answer is to use
(assuming "-filename" is in the current directory, of course.)
This method of avoiding the interpretation of the "-" works with
other commands too.
Many commands, particularly those that have been written to use
the "getopt(3)" argument parsing routine, accept a "--" argument
which means "this is the last option, anything after this is not
an option", so your version of rm might handle "rm -- -filename".
Some versions of rm that don't use getopt() treat a single "-"
in the same way, so you can also try "rm - -filename".
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!