how do delete file with special name ??

how do delete file with special name ??

Post by Lew Pitch » Fri, 29 Sep 2000 04:00:00




>i created a file called -g accidentally and now i can't delete it becuz unix
>treat it as option ..

>what should i do?

It's in the FAQ, but here's the answer

  rm /path/to/file/-g

or

  cd /path/to/file
  rm ./-g

Lew Pitcher
System Consultant
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')

 
 
 

how do delete file with special name ??

Post by Brian Huntle » Fri, 29 Sep 2000 04:00:00




Quote:> i created a file called -g accidentally and now i can't delete it
becuz unix
> treat it as option ..

> what should i do?

rm ./-g

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

how do delete file with special name ??

Post by Jonathan Fosburg » Fri, 29 Sep 2000 04:00:00




>> i created a file called -g accidentally and now i can't delete it becuz unix
>> treat it as option ..

>> what should i do?
> It's in the FAQ, but here's the answer
>   rm /path/to/file/-g
> or
>   cd /path/to/file
>   rm ./-g

Or you can rm -- -g

--
Jonathan Fosburgh

 
 
 

how do delete file with special name ??

Post by Tim Heane » Fri, 29 Sep 2000 04:00:00



> i created a file called -g accidentally and now i can't delete it becuz unix
> treat it as option ..

> what should i do?

> thx

As you can imagine, you are not the first one to do this...

  http://www.faqs.org/faqs/unix-faq/faq/part2/section-1.html

Hope this helps,

Tim

 
 
 

how do delete file with special name ??

Post by Insomni » Sat, 30 Sep 2000 05:44:12


i created a file called -g accidentally and now i can't delete it becuz unix
treat it as option ..

what should i do?

thx

 
 
 

1. deleting file with special character in name

Through some unfortunate mistyping on my part, I've got a file called
"-C" on my Solaris box.  I've been trying to get rid of it, but every
method I've tried has failed.

I tried
  rm -C
and
  rm \-C
and
  rm "-C"
and
  rm "\-C"

but none of those work.  Can somebody show me a method that will
delete it?  Is there perhaps some way to determine it's inode and use
that to delete it?

thanks,

John.

2. tcp Ports 263 264 and 265

3. File names lose special characters in names when moved to Sol10

4. NY Linux Users Group March Meeting 3/19: Helix DNA, Open Source Digital Video

5. \\\ Professional Images Virtual Domains/// Special Special Special Special

6. DSL masquerading firewall craziness

7. Special file names in prototype file

8. (Newbie)How to add path?

9. delete a special character file

10. Deleting many files at once with wilcard characters in the file names

11. deleting 'special char' files

12. Deleting files with special ch in filename

13. How to delete special files on msdos partition?