Tar
tar xvf tarball.tar path/to/file
source
tar xvf tarball.tar -C dest_dir
tar xvf tarball.tar --strip-components=1
Search a file
tar tf archive.tar | grep file
Search if a string is present into files of multiple archives
find . -name \*.tar.gz -print0 | xargs -0 zgrep "STRING"
source
Total size if uncompressed
zcat archive.tar.gz | wc -c
# or faster and more verbose on multiple archives
gzip -l *.tar.gz
source
Original size of a file (with no unzip)
tar ztvf archive.tar.gz -v --wildcards '*file.txt'
tar xvf archive.tar.gz -O | grep "pattern"
source