This question already has an answer here:
- Is `-` used only with cd? 7 answers
Given this diff command:
./a.out < 1.in | diff - 1.out
What does -
mean after the word diff?
Thanks for the help!
This question already has an answer here:
Given this diff command:
What does |
|||
marked as duplicate by Michael Homer, cuonglm, Ramesh, jasonwryan, Kyle Jones Jan 19 at 4:33This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
|||
Traditionally, - means stdin (standard input). As you're redirecting, the output of the first command is the input of the second. |
|||
|
diff
in particular,-
is defined as standard input. – Michael Homer Jan 19 at 3:39-
to mean either stdin or stdout, as appropriate. Eg,wget -q -O- http://example.com
dumps the fetched HTML data to stdout (the-q
is for quiet mode so progress info isn't mixed with the HTML). – PM 2Ring Jan 19 at 9:35