How do I remove a file with 2 hypens in the name, like --karmic.list [duplicate]

How can I read, write, or delete a file which has a name beginning with a pair of hyphens?

In my /etc/apt/sources.list.d/ there is a set of files whose name starts with --karmic.list .

When I try to rm or vim from the command line, it considers it as argument and reports as unknown arg.

How can I deal with this? How is it possible to select a file with this kind of name?


Solution 1:

Use the full path /etc/apt/sources.list.d/--whatever or in the directory ./--whatever, or use rm -- --whatever.