[CentOS] Removing a file that starts with dashes

John R. Dennison jrd at gerdesas.com
Wed Apr 2 21:16:51 UTC 2014


On Wed, Apr 02, 2014 at 02:05:08PM -0700, benfell at parts-unknown.org wrote:
> On Wed, Apr 02, 2014 at 09:51:41AM -0500, Frank M. Ramaekers wrote:
> > rm: unrecognized option `--backup=numbered'
> > Try `rm ./'--backup=numbered'' to remove the file `--backup=numbered'.
> 
> This is what's worked for me. I know the double dash is supposed to
> stop interpretation of arguments, but it hasn't worked for me.

I do not post solutions unless they work:


tty3 jrd at frodo:/tmp/jrd$ ls -l
total 0
-rw-rw-r--. 1 jrd jrd 0 Apr  2 16:14 --silly-file-name
tty3 jrd at frodo:/tmp/jrd$ rm -- --silly-file-name
rm: remove regular empty file `--silly-file-name'? y
tty3 jrd at frodo:/tmp/jrd$ ls
tty3 jrd at frodo:/tmp/jrd$

What shell are you using?  Perhaps that is interfering.




						John
-- 
The most valuable thing you can make is a mistake - you can't learn
anything from being perfect.

-- Adam Osborne (1939-2003), American entrepreneur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20140402/2f51adc4/attachment.sig>


More information about the CentOS mailing list