Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Commands»3 Most Popular Tools to Archive Files and Directories in Linux

    3 Most Popular Tools to Archive Files and Directories in Linux

    By RahulNovember 22, 20142 Mins Read

    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

    Advertisement

    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
    

    archive compress gzip tar zip
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    cp Command in Linux (Copy Files Like a Pro)

    dd Command in Linux (Syntax, Options and Use Cases)

    Top 10 JQ Commands Every Linux Developer Should Know

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.