Computing.Net > Forums > Unix > Deleting a file in unix

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Deleting a file in unix

Reply to Message Icon

Name: pbekal
Date: September 21, 2006 at 09:59:24 Pacific
OS: HPUX
CPU/Ram: RISC
Product: HP
Comment:

How can I delete a file with the name -C in unix? I tried below and get the error.
> rm "-C"
rm: illegal option -- C
Usage: rm [-Rfir] file ...




Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: September 21, 2006 at 12:40:42 Pacific
Reply:

Getting rid of a file that has a dash in it - short of blowing away the whole directory - is nearly impossible.

This is the only way I've determined. Go to the directory immediately above where the -C file resides. For this example, assume the file is in the directory, rr. Execute:

rm -i rr/-C

Press Y when prompted to remove the file.



0

Response Number 2
Name: praveen_indramo
Date: September 28, 2006 at 13:10:31 Pacific
Reply:

You can also try:

1)rm -- -C
2)rm ./-C

Regards,

Praveen Indramohan


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Deleting a file in unix

Tips in creating files in UNIX www.computing.net/answers/unix/tips-in-creating-files-in-unix/7477.html

how to get fixed width file in unix www.computing.net/answers/unix/how-to-get-fixed-width-file-in-unix/7719.html

deleting a route in UNIX www.computing.net/answers/unix/deleting-a-route-in-unix/8507.html