Difference between revisions of "Removing files with weird names"

From Noah.org
Jump to navigationJump to search
m
Line 1: Line 1:
 
[[Category:Engineering]]
 
[[Category:Engineering]]
[[Category:Disks_and_Filesystems]]
+
[[Category:Drives_and_Filesystems]]
 
In a shell run this command:
 
In a shell run this command:
  

Revision as of 08:12, 4 August 2010

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