Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete a file that begins with a -

Status
Not open for further replies.

jd99

MIS
May 17, 2001
101
US
I have a file in my home directory that I am trying to delete. It begins with a dash,its called "-C" therefore anything I have tried to delete gives me invalid option error messages. I even tried rm \-C. Please let me know of a way to delete this file.

Thanks
Joe
 
Never mind, I looked at the man page and figured it out. rm -- -C .

Thanks anyways,
Joe
 
You could also enclose the file name in quotes I believe.
 
I tried the quotes, no dice. The rm -- -C is the only thing that worked.

Thanks,
JD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top