gzip (.gz)
Fastest in most cases, good compression ratio. Ideal for backups and logs you compress regularly.
Solaris · Archive
Solaris · Lesson 13
Create tar and cpio archives. Backup and restore methods. Compression utilities. Admin level examples.
Many admins mix the words archive and compression, but they are different concepts:
.tar.gz, .tar.bz2, .tar.xz.Fastest in most cases, good compression ratio. Ideal for backups and logs you compress regularly.
Slower than gzip but usually better compression. Good when you want smaller archives and can wait a bit longer.
Often gives the best compression ratio, but slowest. Use for long-term archives or software distributions.
Use these flows in your Solaris lab VM. Work in a test directory so you can create and remove archives freely.
Archiving (tar) combines many files into one. Compression (gzip/bzip2/xz) reduces size. Often you archive first, then compress.
gzip is usually the default choice: decent compression with good speed.
bzip2 and xz usually give a smaller file than gzip, but take more CPU/time. Use them for archives you rarely touch.
Use tar cvf to create an archive, tvf to list it, and xvf to extract it.
Combine archiving and compression in a single tar command using -z (gzip), -j (bzip2) or -J (xz).
Use xzvf / xjvf / xJvf to extract tar archives compressed with gzip, bzip2 and xz.
tar cvf, tar czvf, tar cjvf and tar cJvf, and compare resulting sizes.Archive and compression skills will be used again for log rotation, backups and moving data between Solaris and Linux systems.