Skip to content

3 Most Popular Tools to Archive Files and Directories in Linux

Top 3 Most Popular Tools to Archive Files and Directories in Linux. Linux Command line archive tools. 3 quickly used commands for archiving files in linux

Covers
tar
On this page

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 – Zip

zip is the most popular command line archiving utility for Linux systems.

Create Archive of File

# zip output.zip /var/log/*.log

Create Archive of Directory

# zip -r output.zip /var/log

Extract Archive

# unzip output.zip

Tool 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/*.log

Create Archive of Directory

# zip -cf output.tar /var/log

Extract Archive

# tar -xf output.tar

Tool 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.log

Create zip file of piped data

# cat /var/log/messages | gzip > messages.gz

Extract Archive

# gunzip access.log.gz

Combined – 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/*.log

Create Archive of Directory

# zip -czf output.tar.gz /var/log

Extract Archive

# tar -xzf output.tar.gz

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top