Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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?

share|improve this question

marked as duplicate by minerz029, Lucio, Eric Carvalho, Seth, Braiam Feb 12 '14 at 1:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 10 down vote accepted

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

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.