Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

Possible Duplicate:
What does “--” (double-dash) mean?

There are many command line tools that take a single "--" argument. For example:

gem install mysql -- —–with-mysql-config=/usr/local/mysql/bin/mysql_config

It seems to be used as some kind of separator. Does it have a special meaning? Is it a commonly used idiom? If so, what's its purpose?

PS: I'm not talking about arguments of the form --argument, I'm talking about when you have a -- followed by white characters and other arguments.

share|improve this question

marked as duplicate by manatwork, Mat, jw013, Renan, jasonwryan Oct 20 '12 at 18:16

This question was marked as an exact duplicate of an existing question.

That dup was already pointed out to you on your SU question. Why did you feel the need to repost here? – Mat Oct 20 '12 at 15:40

-- is a convention that many programs honor. It means "ignore this argument, and treat all following words as command-line ARGUMENTS rather than command-line OPTIONS. Even if they begin with - or --."

For instance, if you have the misfortune to have a file named -f, how would you delete it? rm -f wouldn't work, because the -f is interpreted as an option to the rm command. But fortunately, the rm command honors the -- convention, so you can delete that file using:

rm -- -f
share|improve this answer

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