Here’s a table that provides the description, syntax, and example for Unix commands for compression and decompression:
Command | Description | Syntax | Example |
---|---|---|---|
gzip file | Compress a file using gzip format | gzip file.txt | |
gunzip file.gz | Decompress a gzip-compressed file | gunzip file.gz | |
tar -czvf file.tar.gz directory | Compress a directory into a tar archive with gzip format | tar -czvf file.tar.gz directory | |
tar -xzvf file.tar.gz | Decompress a tar archive with gzip format | tar -xzvf file.tar.gz | |
bzip2 file | Compress a file using bzip2 format | bzip2 file.txt | |
bunzip2 file.bz2 | Decompress a bzip2-compressed file | bunzip2 file.bz2 | |
zip file.zip file | Compress one or more files into a zip archive | zip file.zip file1 file2 file3 | |
unzip file.zip | Decompress a zip archive | unzip file.zip |