Differences between tar(1) implementations
Autodetection of compression
- libarchive and busybox autodetects for both files and pipes, without using a child process
- heirloom tar autodetects for both files and pipes, with using a child process for decompression
- GNU tar autodetects for both but throws an error for pipes
Testing the pipes case:
- Check cat isn't a shell builtin:
command -v cat
cat foobar.tar.gz | tar tvf -
cat(1)
used here to be sure it is pipes and not fd referring to a file.
See also
- On the file formats side of things: Portability of tar features - Michał Górny