Re: [Hampshire] how do I delete a file named -n

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] how do I delete a file named -n

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x5703d100.hantslug.org.uk.13951': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Thu Feb 1 19:00:55 2007 GMT
gpg: using DSA key B2C27BC21C335860
gpg: Can't check signature: No public key
On Thu, Feb 01, 2007 at 06:23:37PM +0000, Gordon Scott wrote:
> On Wed, 31 Jan 2007, Chris Liddell wrote:
> > If there aren't other files it would impact, you could try:
> >
> > rm ?n
>
> you can of course do:
> rm -i ?n
> which is interactive and asks you to confirm deletion.
> That also helps avoid deleting other files accidently.


Still doesn't work:

hrm@willow:~$ touch -- -n
hrm@willow:~$ rm -i ?n
rm: invalid option -- n
Try `rm ./-n' to remove the file `-n'.
Try `rm --help' for more information.

Interestingly:

hrm@willow:~$ rm --help
Usage: rm [OPTION]... FILE...
[...]
To remove a file whose name starts with a `-', for example `-foo',
use one of these commands:
rm -- -foo

rm ./-foo


Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 1C335860 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
    --- There is no dark side to the Moon, really. As a matter of ---    
                          fact,  it's all dark.