What Does ‘-‘ Mean as an Argument to a Command?

command linetar

I found this link on how to open tgz in one step.

gzip -dc target.tar.gz | tar xf -

What does the '-' mean?

Best Answer

It's a common convention to use - in a filename argument to mean stdin or stdout; tar follows the same convention. From the man page:

   -f, --file [HOSTNAME:]F
          use archive file or device F (default "-", meaning stdin/stdout)
Related Question