6

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?

belacqua
  • 23,540
Shoaib Nawaz
  • 2,389

1 Answers1

10

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

Random832
  • 1,155