I get the following error when trying to uncompress piped tar file with the following command :
$ git archive --format=tar 0af62b1 | tar -xf -C /the/path/here/
tar: -C: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
The first part git archive --format=tar 0af62b1
outputs a tar file, printed on the screen. This output can be captured in a file by using the parameter --output file_name
.
In the second part I'm trying to extract the content of the file into the indicated path. When run separately both work perfectly git archive 0af62b1 --output file_name
followed by tar -xf file_name -C /the/path/here/
.
Why piping is not possible in this case and how do I know if a certain command accepts piped input?
f
requires a filenametar
command interprets-C
as the filename.