Take the 2-minute tour ×
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.

This question already has an answer here:

Given this diff command:

./a.out < 1.in | diff - 1.out

What does - mean after the word diff?
Thanks for the help!

share|improve this question

marked as duplicate by Michael Homer, cuonglm, Ramesh, jasonwryan, Kyle Jones Jan 19 at 4:33

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.

1  
For diff in particular, - is defined as standard input. –  Michael Homer Jan 19 at 3:39
    
As the link mentions, many commands use - 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

1 Answer 1

up vote 2 down vote accepted

Traditionally, - means stdin (standard input). As you're redirecting, the output of the first command is the input of the second.

share|improve this answer

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