Ubuntu – What’s the difference between a compressed folder (with files) and a compressed Tar archive

compressiontar

I don't understand the use of TAR. My understanding is it pulls together many files into one file. But doesn't putting files in a folder do this?

Using ZIP, I put files I want to archive in a folder and then compress the folder.

Do I also get an archive if I put files I want to archive in a folder and then compress with Bzip2?

Best Answer

tar lives up to its name "Tape ARchiver". It takes a directory tree, and writes it out to a single file (which could be a tape drive), preserving the directory structure and metadata.

So, yes, very similar to zip, although without built-in compression, and with a full understanding of unix metadata.

The unix philosophy is that each tool should do one thing, and do it well. Tar can archive a directory, and the you can compress the archive with a compression tool like gzip, bzip2, or xz.

Related Question