Linux Compression Tools - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux Compression Tools Guide
Complete beginner-friendly guide to compression tools on Linux, covering Arch Linux, CachyOS, and other distributions including tar, zip, 7z, and compression utilities.
Table of Contents
tar
Create Archive
Create tar:
# Create tar
tar -cf archive.tar files/
# Create compressed tar
tar -czf archive.tar.gz files/
# Create bzip2
tar -cjf archive.tar.bz2 files/
# Create xz
tar -cJf archive.tar.xz files/
Extract Archive
Extract tar:
# Extract
tar -xf archive.tar
# Extract to directory
tar -xf archive.tar -C /path/to/directory
# List contents
tar -tf archive.tar
zip/unzip
Create Zip
Create zip:
# Install zip
sudo pacman -S zip
# Create zip
zip archive.zip files/
# Recursive
zip -r archive.zip directory/
Extract Zip
Extract zip:
# Install unzip
sudo pacman -S unzip
# Extract
unzip archive.zip
# Extract to directory
unzip archive.zip -d /path/to/directory
7-Zip
Install 7z
Install 7-Zip:
# Arch/CachyOS
sudo pacman -S p7zip
# Debian/Ubuntu
sudo apt install p7zip-full
# Fedora
sudo dnf install p7zip
Use 7z
Create archive:
# Create archive
7z a archive.7z files/
# Extract
7z x archive.7z
Other Compression Tools
gzip
Use gzip:
# Compress
gzip file.txt
# Decompress
gunzip file.txt.gz
bzip2
Use bzip2:
# Compress
bzip2 file.txt
# Decompress
bunzip2 file.txt.bz2
Troubleshooting
Archive Errors
Check archive:
# Test archive
tar -tf archive.tar
# Check zip
unzip -t archive.zip
Summary
This guide covered compression tools for Arch Linux, CachyOS, and other distributions, including tar, zip, 7z, and other utilities.
Next Steps
- Backup and Restore - Backups
- File Managers - File management
- ArchWiki Compression: https://wiki.archlinux.org/title/Compression
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.