Can't remove a file called "---remove-files"

Can't remove a file called "---remove-files"

Post by Stev » Fri, 22 Nov 2002 02:40:31



Hi,

I managed to create a file called "--remove-files" when creating a tar
archive, and now cannot remove it. I've tried escaping the dashes in
various ways, but rm interprets it as a switch, so refuses to let me
remove it.

Please help!

Steve Field

 
 
 

Can't remove a file called "---remove-files"

Post by Billy O'Conno » Fri, 22 Nov 2002 02:47:39



> Hi,

> I managed to create a file called "--remove-files" when creating a tar
> archive, and now cannot remove it. I've tried escaping the dashes in
> various ways, but rm interprets it as a switch, so refuses to let me
> remove it.

rm -- ---remove-files

--
Billy O'Connor
Editor, Beyond Linux From Scratch    http://beyond.us.linuxfromscratch.org

 
 
 

Can't remove a file called "---remove-files"

Post by Bit Twiste » Fri, 22 Nov 2002 02:52:08



Quote:> Hi,

> I managed to create a file called "--remove-files" when creating a tar
> archive, and now cannot remove it. I've tried escaping the dashes in
> various ways, but rm interprets it as a switch, so refuses to let me
> remove it.

Hmmm, works for me, have you tried     man rm    

If it does not give any hints you could try

rm -i *rem*file*

Please read http://www.tuxedo.org/~esr/faqs/smart-questions.html

 
 
 

Can't remove a file called "---remove-files"

Post by Lew Pitch » Fri, 22 Nov 2002 03:35:10


On 20 Nov 2002 09:40:31 -0800, in comp.os.linux.admin,


>Hi,

>I managed to create a file called "--remove-files" when creating a tar
>archive, and now cannot remove it. I've tried escaping the dashes in
>various ways, but rm interprets it as a switch, so refuses to let me
>remove it.

Try

  cd /path/to/directory
  rm ./--remove-files

or

  rm /path/to/directory/--remove-files

or (if you have the GNU enhanced 'rm')

  cd /path/to/directory
  rm -- --remove-files

The first two suggestions work with *any* rm (or *any* other app, for that
matter), while the last suggestion depends on the 'rm' app recognizing the
special '--' option (some 'rm' apps dont recognize that option).

Lew Pitcher, Information Technology Consultant, Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employer's.)