Linux: Extract or Compress files zip, tar.gz

Extract a .zip file in the current directory:

unzip package.zip .

Extract a .tar.gz file in the current directory:

tar -xvzf package.tar.gz

Compress a file to .zip format:

zip notes.txt.zip notes.txt

Compress a fild to tar.gz format:

tar -zcvf notes.txt.tar.gz notes.txt

Leave a Reply