retrohacker
retrohacker

Reputation: 3234

Need to delete a file -ggdb

So I kinda messed up an managed to create a file named -ggdb in my home directory on a Debian distribution. I have tried surrounding it with " to make it a string literal (like so: rm "-ggdb") but i get the following error: rm: invalid option -- 'g'...

When I try rm "\-ggdb" I get the following error:

rm: cannot remove '\\-ggdb': No such file or directory

Any ideas?

Upvotes: 1

Views: 583

Answers (2)

user933161
user933161

Reputation:

Try this:

rm -- -ggdb

rm ./-ggdb

Upvotes: 3

Vladimir Kadalashvili
Vladimir Kadalashvili

Reputation: 757

The following command will work:

rm "\-ggdb"

Upvotes: -1

Related Questions