Compression commands in Termux help you pack files into smaller sizes and extract them when needed. These commands are very useful when you want to save storage space or share multiple files easily in one package.
Compression & Archiving Commands List
| Command | Use | Example |
|---|---|---|
| zip | Compress files | zip file.zip file.txt |
| unzip | Extract zip file | unzip file.zip |
| tar -cvf | Create tar archive | tar -cvf file.tar folder/ |
| tar -xvf | Extract tar archive | tar -xvf file.tar |
| tar -czvf | Create tar.gz file | tar -czvf file.tar.gz folder/ |
| tar -xzvf | Extract tar.gz | tar -xzvf file.tar.gz |
| gzip | Compress file | gzip file.txt |
| gunzip | Decompress gzip file | gunzip file.txt.gz |
| rar | Create rar archive | rar a file.rar folder/ |
| unrar | Extract rar file | unrar x file.rar |
| 7z | Compress using 7zip | 7z a file.7z folder/ |
| 7z x | Extract 7zip file | 7z x file.7z |
These Termux compression commands help you save space and manage files efficiently. They are very useful when sharing or backing up data in Termux.
Quick Examples
Create a zip file:
zip test.zip file.txtExtract a zip file:
unzip test.zipCreate tar.gz file:
tar -czvf backup.tar.gz folder/Extract tar.gz file:
tar -xzvf backup.tar.gz