removing a file with hyphens

Luis Motta Campos luismottacampos at yahoo.co.uk
Fri Jun 8 13:46:59 BST 2007


On Jun 7, 2007, at 5:04 PM, Stig Brautaset wrote:
> On 7 Jun 2007, at 7 Jun 15:40, Matt Wilson wrote:
>> If you really need to get that file I'd recommend:
>>
>> $ rm -rf *
>>
>> It's the only surefire way.
>
> Except it doesn't work :)
>
>  % mkdir /tmp/foo
>  % cd /tmp/foo
>  % touch -- foo bar baz --nonexistantoption
>  % rm -rf *
> rm: unrecognised option `--nonexistantoption'
> Try `rm --help' for more information.
>
> Putting an empty file called '-i' in directories you care about  
> might not be a bad idea.

   It wastes an Inode and don't prevent shell-freaks like me from saying

   /bin/rm -fR -- *

   and getting rid of the files, for instance...

--
Luis Motta Campos (a.k.a. Monsieur Champs) is a software engineer,
Perl fanatic evangelist, and amateur {cook, photographer}




More information about the london.pm mailing list