1829399 Members
1687 Online
109991 Solutions
New Discussion

unable to remove file

 
SOLVED
Go to solution
Ridzuan Zakaria
Frequent Advisor

unable to remove file

Hi,

I accidently created a file with the following name:

-C

However I am not able to remove it.

$ rm -C
rm: illegal option -- C
Usage: rm [-Rfir] file ...

Does anyone know how to remove the file?

Thanks.
Ridzuan

quest for perfections
4 REPLIES 4
Robert Salter
Respected Contributor

Re: unable to remove file

Try backslashing it i.e. rm \-C
Time to smoke and joke
Volker Borowski
Honored Contributor
Solution

Re: unable to remove file

rm xxxxxxx '-C'

option 1) rm xxxxxxx '-C'
ignore the message about File "xxxxxxx" not found.

option 2) use ftp

Volker
Robert Salter
Respected Contributor

Re: unable to remove file

Hmmm, my previous reply, that won't work, you should probably try using the full path to the file,i.e.
rm /tmp/-C
Time to smoke and joke
Ridzuan Zakaria
Frequent Advisor

Re: unable to remove file

Thanks everyone. I am using Volker's first suggestion and it works fine.

Thanks again.
quest for perfections