Archiving & Compression in Linux with tar and zip

Day 28/100: Bundling It Up – Archiving & Compression in Linux 🗜️📦 Today’s Focus: In a real-world DevOps environment, servers generate massive amounts of log files and data (like the Jenkins logs I was working with today!). To save disk space and make transferring files over a network much faster, I learned how to properly archive and compress directories using the Linux CLI. 🛠️ The Tools I Mastered: I practiced bundling multiple files into a single archive and applying compression algorithms to shrink their size: The Mighty tar (Tape Archive): This is the undisputed king of Linux archiving. I learned the classic command flag combinations: tar -czvf archive.tar.gz [directory]: This creates a new archive (-c), compresses it using gzip (-z), shows me the progress verbosely (-v), and outputs it to a file (-f). tar -xzvf archive.tar.gz: The exact opposite! This extracts (-x) the compressed tarball back into a usable directory. I also explored the manual to see other powerful compression options like -j for bzip2 and -J for xz. zip & unzip: I also practiced using the standard zip -r command to recursively compress a directory. While tar is the Linux standard, zip is incredibly useful when I need to share artifacts with Windows environments! Why It Matters: Whether it is backing up application configurations, rotating system logs, or packaging up a build artifact to deploy to a server, we rarely move raw directories around. Compressing everything into a single "tarball" saves bandwidth, storage, and time! ⏳ #100DaysOfDevOps #100DaysOfCode #Linux #Tarball #SysAdmin #CentOS #Vagrant #CLI #DevOpsEngineer #TechJourney #DailyProgress #CloudComputing

To view or add a comment, sign in

Explore content categories