Search code examples
debianrm

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?


Solution

  • Try this:

    rm -- -ggdb
    
    rm ./-ggdb