How to pipe output of a command that expects file argument
Some programs have special handling for -
. For example, you can tell tar
to write to stdout so it can be used in a pipeline. This would create a tarball locally and untar it remotely without the tarball ever being written to disk:
tar -cf - *.txt | ssh user@host tar -C /dir/ -xf -
You can use /dev/stdout
with nearly all programs, as long as they don't need a seekable file.
command --save-to-file /dev/stdout