Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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?

What does '--' (two dashes) mean with association to Linux files and directories.

I've found something else but not too sure if it is correct and relates to the same thing. "Another convention is to use '--' (two dashes) to indicate the end of flags, and the beginning of file names."

share|improve this question

marked as duplicate by jasonwryan, jw013, Mat, Caleb, Chris Down Nov 17 '12 at 14:08

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.

There is no association to files and directories. It is a signal when providing arguments to commands that you are done supplying options / arguments, and are listing a 'target' of some kind, either a file or a directory maybe. Can you show an example of what you are trying to do? – vgoff Nov 17 '12 at 1:35
On my browser it looks like you are referring to single - but the words you are both using are more accurate descriptions of --. – dubiousjim Nov 17 '12 at 1:46
I thought the same thing, but too small an edit, so I just answered with the assumption. Hopefully they will edit it if it is incorrect. – vgoff Nov 17 '12 at 2:47
Well, - has a meaning too when used as a filename (it typically means stdin/stdout), but the second paragraph is clearly talking about --, so I'm not sure which he actually wants – Michael Mrozek Nov 17 '12 at 3:07

I'm not sure if you mean - or --, so here's some information about both:

- is a shorthand that some programs accept to refer to STDIN, the standard input of the program. That is, in a pipeline like echo foo | cat - (although - is actually unnecessary in this instance), cat receives "foo" and a newline as its input from STDIN.

-- indicates the end of arguments. In programs that deal with files, this often means that what follows will only be filenames, and not, say, command-line options. In such an instance it is used to try and get around filenames that look like options (for example, if you have a file named -e and an the program also accepts a -e argument). Another way to get around this is to do something like command ./-e, which is actually more compatible across programs as it doesn't require the underlying program to implement handling --.

share|improve this answer

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