Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
231
rated 0 times [  231] [ 0]  / answers: 1 / hits: 176681  / 3 Years ago, tue, september 21, 2021, 10:46:21

Recently, I've been backing up a lot of my data, and I noticed that I can save files as .gz or .tar.gz, or .7z and .tar.7z, etcetera. What are the differences between the normal one and the .tar.* variant? Which one of them is adviced when making backups?


More From » backup

 Answers
0

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 have only 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).


[#39291] Thursday, September 23, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
girdleas

Total Points: 1
Total Questions: 112
Total Answers: 114

Location: Lesotho
Member since Wed, Jun 2, 2021
3 Years ago
;