Archiving & Compression with Tar & Gzip
Learn how systems administrators create backups, compress logs into tarballs, and unpack software releases using `tar` and `gzip`.
Lesson Objectives
3 Steps1Step 1: Create a Compressed Tarball Archive
Run `tar -czvf projects_backup.tar.gz /home/user/projects` to bundle the projects folder.
2Step 2: Inspect Archive Contents without Extracting
Run `tar -tvf projects_backup.tar.gz` to verify the list of packaged files.
3Step 3: Decompress Archive into Target Folder
Run `tar -xzvf projects_backup.tar.gz` to extract the archived files.
💡 Pro Tip:
Remember the mnemonic for creating archives: `-czvf` (Create, Gzip, Verbose, File), and extracting: `-xzvf` (eXtract, Gzip, Verbose, File).
bash — terminal
AST Sandbox (Free)