5

Given this diff command:

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

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

Teddy Hartanto
  • 153
  • 1
  • 5
  • 1
    For `diff` in particular, [`-` is defined as standard input](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html#tag_20_34_05). – Michael Homer Jan 19 '15 at 03: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 **q**uiet mode so progress info isn't mixed with the HTML). – PM 2Ring Jan 19 '15 at 09:35

1 Answers1

7

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

Alejandro
  • 86
  • 1