Published January 21, 2018 by

Different File Archive Types of Linux

In this article, we are learning and understand on different and popular file archive types of Linux with example.

.tar

TAR stands for Tape Archive. tar is the simple format in which files are combined into a larger file. Handled by the tar command at the command-line. Tar files are not automatically compressed. The chief benefit of tar files is that they record permission and ownership details, making them ideal for backup.

# tar -czf serverkaka.tar /home/serverkaka/subhash/              ## For Archive
# tar -xzf serverkaka.tar                                                         ## For Extract


.tar.gz

Tar archives that have been additionally compressed using the gzip software, usually at the point of creation. Sometimes the .tgz file extension is used instead of .tar.gz.

# tar -czf serverkaka.tar.gz /home/serverkaka/subhash/          ## For Archive
# tar -xzf serverkaka.tar.gz                                                     ## For Extract

.tar.bz2

Tar archives that have been additionally compressed using the bzip2 software, usually at the point of creation. Bzip2 compression leads to the smallest files of all, so is preferable. Sometimes the .tbz file extension is used instead of .tar.bz2.

# tar -cjf serverkaka.tar.bz2 /home/serverkaka/subhash/          ## For Archive
# tar -xjf serverkaka.tar.bz2                                                     ## For Extract

.zip

As with Windows, zip files are compressed archives. Zip files have not gained much traction in the Linux/Unix world because of legal concerns some years ago. This is no longer an issue, but other archive formats such as gzip and bzip2 are simply more established.

# zip -r serverkaka.zip /home/serverkaka/subhash/               ## For Archive
# unzip serverkaka.zip                                                          ## For Extract