1

I recently had to use some code that was given to me, and in it the is this line

cat file -

Did someone know what the - mean.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
Xiidref
  • 1,456
  • 8
  • 20

1 Answers1

3

The - means "read from standard input" (this is a POSIX convention). Try this in your shell and you'll see cat repeat everything you type:

$> cat -
Travis Gockel
  • 26,877
  • 14
  • 89
  • 116
  • Ever-so-slightly more nuanced: "read from standard input" in an input position, "write to standard output" in an output position. – Charles Duffy Jan 14 '20 at 18:57