What's the difference between .tar.gz and .gz, or .tar.7z and .7z?

1

Answer #: 1

If you come from a Windows background, you may be familiar with the zip and rar formats. These are archives of multiple files compressed together.

In Unix and Unix-like systems (like Ubuntu), archiving and compression are separate.

tar puts multiple files into a single (tar) file.

gzip compresses one file (only).

So to get a compressed archive, you combine the two, first use tar or pax to get all files into a single file (archive.tar), then gzip it (archive.tar.gz). If you only have one file you need to compress (notes.txt), there’s no need for tar, so you just do gzip notes.txt which will result in notes.txt.gz. There are other types of compression, such as compress, bzip2 and xz which work in the same manner as gzip (apart from using different types of compression of course)

Answer #: 2

It depends on what you are looking for… Compression or archiving?

When I talk about archiving, I mean...

0 0
2

[ http://askubuntu.com/questions/122141/whats-the-difference-between-tar-gz-and-gz-or-tar-7z-and-7z ]

[+124] [2012-04-15 01:41:12] geirha [

ACCEPTED]

If you come from a Windows background, you may be familiar with the zip and rar formats. These are archives of multiple files compressed together.

In Unix and Unix-like systems (like Ubuntu), archiving and compression are separate.

tar puts multiple files into a single (tar) file.

gzip compresses one file (only).

So to get a compressed archive, you combine the two, first use tar or pax to get all files into a single file (archive.tar), then gzip it (archive.tar.gz). If you only have one file you need to compress (notes.txt), there's no need for tar, so you just do gzip notes.txt which will result in notes.txt.gz. There are other types of compression, such as compress, bzip2 and xz which work in the same manner as gzip (apart from using...

0 0
3

7-Zip is a file archiver with a high compression ratio.

Download 7-Zip 16.02 (2016-05-21) for Windows:

License

7-Zip is open source software. Most of the source code is under the GNU LGPL license. The unRAR code is under a mixed license: GNU LGPL + unRAR restrictions. Check license information here: 7-Zip license.

You can use 7-Zip on any computer, including a computer in a commercial organization. You don't need to register or pay for 7-Zip.

The main features of 7-Zip

High compression ratio in 7z format with LZMA and LZMA2 compression Supported formats: Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z. For ZIP and GZIP formats, 7-Zip provides a compression ratio that is 2-10 % better than the ratio...
0 0
4

On Unix platform, tar command is the primary archiving utility. Understanding various tar command options will help you master the archive file manipulation.

In this article, let us review various tar examples including how to create tar archives (with gzip and bzip compression), extract a single file or directory, view tar archive contents, validate the integrity of tar archives, finding out the difference between tar archive and file system, estimate the size of the tar archives before creating it etc.,

1. Creating an archive using tar command

Creating an uncompressed tar archive using option cvf

This is the basic command to create a tar archive.

$ tar cvf archive_name.tar dirname/

In the above command:

c – create a new archive v – verbosely list files which are processed. f – following is the archive file name

Creating a tar gzipped archive using option cvzf

The above tar cvf option, does not provide any...

0 0
5
...
0 0
6

It depends on what you are looking for... Compression or archiving?

When I talk about archiving, I mean preserving permissions, directory structure, etc...

Compression may ignore most of that and just get your files in a smaller packages.

To preserve file permissions, use tar:

tar cpvf backup.tar folder

The p flag will save file permissions. Use the z flag for gzip compression or the j flag for bzip compression.

tar czpvf backup.tar.gz folder #backup.tgz is acceptable as well tar cjpvf backup.tar.bz2 folder #backup.tbz2 works too

If you want to have a tar file you can "update" package the tar using the P flag:

tar cpPvf backup.tar folder

Then to update, replace 'c' with 'u' and when unpacking, you can use 'k' to preserve files that already exist.

tar upPvf backup.tar folder #updating a tar file tar xpPkvf backup.tar #extracting a tar with permissions(p) and not extracting(k) files that exist on disk already

The P flag saves files...

0 0
7

I did my own benchmark on 1.1GB Linux installation vmdk image:

rar =260MB comp= 85s decomp= 5s 7z(p7z)=269MB comp= 98s decomp=15s tar.xz =288MB comp=400s decomp=30s tar.bz2=382MB comp= 91s decomp=70s tar.gz =421MB comp=181s decomp= 5s

all compression levels on max, CPU Intel I7 3740QM, Memory 32GB 1600, source and destination on RAM disk

I Generally use rar or 7z for archiving normal files like documents.
and for archiving system files I use .tar.gz or .tar.xz by file-roller or tar with -z or -J options along with --preserve to compress natively with tar and preserve permissions (also alternatively .tar.7z or .tar.rar can be used)

update: as tar only preserve normal permissions and not ACLs anyway, also plain .7z plus backup and restoring permissions and ACLs manually via getfacl and sefacl can be used which seems to be best option for both file archiving or system files backup because it will full preserve permissions and ACLs, has checksum,...

0 0
8

There are two distinct but related tasks. Packing a tree of files (including filenames, directory structure, filesystem permissions, ownership and any other metadata) into a byte stream is called archiving. Removing redundancy in a byte stream to produce a smaller byte stream is called compression.

On Unix, the two operations are separated, with distinct tools for each. On most other platforms (current and historical) combined tools perform both archiving and compression.

(gzip and other programs that mimic gzip's interface often have the option to store the original filename in the compressed output, but this, along with a CRC or other check to detect corruption, is the only metadata they can store.)

There are advantages to separating compression from archiving. Archiving is platform-specific (the filesystem metadata needing preserving varies widely), but the implementation is straightforward, largely I/O-bound, and changes little over time. Compression is...

0 0
9

.7z

.7z is a compressed archive file format that supports several different data compression, encryption and pre-processing filters. The .7z format initially appeared as implemented by the 7-Zip archiver. Both the 7-Zip program and a library to read the .7z file format are publicly available under the terms of the GNU Lesser General Public License.

Features of the .7z format are:

Open, modular architecture which allows any compression, conversion, or encryption method to be stacked. Compression ratios from about 2 – 10% Ability to compress large files. Largest is about 16 billion GB. Uses a 16-bit code standard for uniform representation of all the character systems in the world, digits, symbols, and control sequences to use when storing data. Support for solid compression, where multiple files of like type are compressed within a single stream, in order to exploit the combined redundancy inherent in similar files. Even archive headers (supplemental data...
0 0
10
...
0 0
11

Read man tar. It offers:

-a, --auto-compress use archive suffix to determine the compression program -j, --bzip2 --lzip --lzma --lzop -z, --gzip, --gunzip --ungzip -Z, --compress, --uncompress

Or, if none of those is right for you, and you have a compression program that reads stdin, you could:

tar cf- $HOME | my_compression_program >/tmp/compressed.output

Note that I'm writing the output somewhere other than $HOME (backing up into a directory that you're backing up leads to unconstrained file growth).

Or, you could read man 7z - it looks like you could do

dir="directory to save" 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on /tmp/archive.7z...
0 0
12







Other archival and compression formats properties


Lear more about CAB packages, and PEA file format.

ARC (or WRC) is a new, open source archiving format developed by Bulat Ziganshin.
The format features strong but speed/memory efficient compression, comparable to or better than RAR an 7Z formats for most filetypes.
ARC format also supports recovery records (like RAR), for attempting data repair in case of corruption of the archive, and strong encryption with AES, Serpent and Twofish (all up to 256 bit key size) and Blowfish.
Interestingly, ARC command line syntax is close to WinRAR one, allowing easy porting of scripts from one program to the other.
PeaZip offers a GUI frontend to create, browse, test, repair and extract ARC/WRC archives under Windows and Linux (on Gnome, KDE or other desktop environments).
ARC/WRC...

0 0