“However, if you think about what this actually does, it still
won’t work. The shell will see the escape, remove it, and pass
plain -file into rm; so you run straight into the same problem.
What you need is an escape sequence for rm itself, not for the
shell.“There are two ways around this. The first one is to use –,
which is used by many commands to indicate the end of the options.
If you’d created a directory called -test and wanted to remove that
directory and everything in it, this command line would work:”
Dealing With Strange Filenames
By
Juliet Kemp
Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends, & analysis