3 Most Popular Tools to Archive Files and Directories in Linux
Abstract: Create Archive of Directory # zip -cf output.tar /var/logCreate Archive of Directory # zip -r output.zip /var/log
There are multiple tools available in Linux system for creating archive files. In this article you will find uses of multiple tools for creating or extracting archive files through command line
Tool 1 – Zipzip is the most popular command line archiving utility for Linux systems.
Create Archive of File# zip output.zip /var/log/*.logCreate Archive of Directory
# zip -r output.zip /var/logExtract Archive
# unzip output.zipTool 2 – Tar
Tar is the another most popular command line archiving utility for Linux systems.
Create Archive of File# tar -cf output.tar /var/log/*.logCreate Archive of Directory
# zip -cf output.tar /var/logExtract Archive
# tar -xf output.tarTool 3 – Gzip
Gzip is one more tool for command line users for making archive files. Gzip also supports to take input of data as standard input or through pipe and create zip file.
Create Archive of File# gzip -k access.logCreate zip file of piped data
# cat /var/log/messages | gzip > messages.gzExtract Archive
# gunzip access.log.gzCombined – Tar + Gzip
Tar also combined gzip program to enable higher compression level of files. Uisng tar with gzip created files extension will be .tar.gz.
Create Archive of File# tar -czf output.tar.gz /var/log/*.logCreate Archive of Directory
# zip -czf output.tar.gz /var/logExtract Archive
# tar -xzf output.tar.gz