Categories
Linux Solutions

Compressing files in Linux & Unix – Cheat Sheet

Here is a quick cheat-sheet on How To Compress files in Linux & Unix

Zip
zip archive file1 file2 file3
Compresses file1 file2 file3 into an achive with filename archive.zip

zip archive *
Compresses all files in the current directory into an achive with filename archive.zip

zip -r archive dir
Compresses the directory dir(and its subdirectories) into an achive with filename archive.zip

unzip archive.zip
Uncompresses the archive archive.zip to the current directory

unzip archive.zip -d dir
Uncompresses the archive archive.zip to the directory dir