Arch Linux Compression Tools - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Arch Linux Compression Tools Guide
Complete beginner-friendly guide to compression tools on Arch Linux, 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 7-Zip
Install 7z:
# Install 7-Zip
sudo pacman -S p7zip
# 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
xz
Use xz:
# Compress
xz file.txt
# Decompress
unxz file.txt.xz
Troubleshooting
Archive Corrupted
Check archive:
# Test tar
tar -tf archive.tar
# Test zip
unzip -t archive.zip
Permission Issues
Fix permissions:
# Extract with permissions
tar -xpf archive.tar
Summary
This guide covered tar, zip, 7-Zip, and other compression tools.
Next Steps
- Find Command Guide - File searching
- Arch Linux System Configuration - System setup
- ArchWiki Compression: https://wiki.archlinux.org/title/Compression
This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.