: Because a raw .tar file is not compressed, it is customary to "filter" it through a compression utility. This creates a "compressed tarball" that is significantly smaller and more efficient for transfer. Common Extensions and Compression Types Compression Method Description .tar Pure archive; no size reduction. .tar.gz / .tgz The most common standard for Linux software. .tar.bz2 Slower but offers higher compression ratios than Gzip. .tar.xz
Unlike a "Zip" file, which performs compression on each file individually, a standard .tar file simply concatenates files into a single stream. tarball file
if tar -tzf "$backup_name" >/dev/null 2>&1; then echo "Valid tarball" else echo "Corrupt tarball" fi : Because a raw
| Extension | Compression | Common Command | |-----------|-------------|----------------| | .tar | None | tar -cf | | .tar.gz , .tgz | gzip | tar -czf | | .tar.bz2 , .tbz2 | bzip2 | tar -cjf | | .tar.xz , .txz | xz (LZMA2) | tar -cJf | | .tar.zst | zstd | tar --zstd | if tar -tzf "$backup_name" >/dev/null 2>&1; then echo