Hi everyone!! I am NOT Topher Grace, nor do I want to be. I am just Topher Scribbles and just for kicks, I really want to out-rank Topher Grace's IMDB website. If you want to help, just link to me. Thanks and enjoy some boring fun!!

Go to http://www.dnsyard.com for some free DNS tools.

Removing Files That Begin With a Dash “-”

So I wasted about an hour of my life trying to figure out how to remove a filename that begins with a dash, like “-filename”. I tried quotes, backslashes, renaming the file, etc., and I still get the error:

rm: illegal option --

How did I figure this out?? Uhh read the manpage…haha

It looks like there are a few ways to do it. Let’s try to delete -filename

# rm -- -filename
# rm /full/path/to/-filename
# rm ./-filename

Done!!

Post a Comment

You must be logged in to post a comment.