Next: Writing to an External Program, Previous: Directory Modification Times and Permissions, Up: Writing
To write the extracted files to the standard output, instead of creating the files on the file system, use --to-stdout (-O) in conjunction with --extract (--get, -x). This option is useful if you are extracting files to send them through a pipe, and do not need to preserve them in the file system. If you extract multiple members, they appear on standard output concatenated, in the order they are found in the archive.
This can be useful, for example, if you have a tar archive containing a big file and don't want to store the file on disk before processing it. You can use a command like this:
tar -xOzf foo.tgz bigfile | process
or even like this if you want to process the concatenation of the files:
tar -xOzf foo.tgz bigfile1 bigfile2 | process
Hovewer, --to-command may be more convenient for use with multiple files. See the next section.