What is a tar file?
Standard tar file is a type of archive that is commonly used in Linux and Unix-based operating systems.
- Zip files
Used for:
- Storage
- Transportation
Tared files are always related.
They contain attributes, paths, ownership and permissions.
What is tarball?
Can be uncompressed in their default format but it contains an uncompressed data stream.
More common to be compressed by an external compression program:
- gzip
- bzip2
- lzip
- lzma
- lzop
- zstd
Difference between tar file and a tarball:
- tar usually used .tar for all compressed
- tarballs uses unique compression file extensions based on what compressed it.(.tgz)
- tarball files are usually just an identification of what software compressed the files.
Tar Compression Quick Reference
gzip | bzip2 | xz | lzip | lzma | lzop | zstd | compress | |||
---|---|---|---|---|---|---|---|---|---|---|
Option | –gzip | –bzip2 | –xz | –lzip | –lzma | –lzop | –zstd | –compress | ||
Flag | -z | -j | -J | – | – | – | – | -Z | ||
Extension | .gz | .bz2 | .tz2 | .xz | .lz | .lzma | .lzo | .zst | .Z | |
Tarball | .tgz | .taz | .tbz | .tbz2 | .txz | – | .tlz | – | .tzst | .taZ |
When in doubt, try: --auto-compress or -a to detect the compression type automatically. |