Removing files with weird names

From Noah.org
Revision as of 08:12, 4 August 2010 by Root (talk | contribs)
Jump to navigationJump to search

In a shell run this command:

touch -- -rf

First thing, don't try to remove this file! Now ask yourself, "How do I delete it?".

Most GNU tools will accept '--' as an option. This tells the option parser to stop interpreting the arguments list as options. For example, to remove a file named "-rf" do this:

rm -- -rf