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 ./-filenameDone!!
Post a Comment
You must be logged in to post a comment.