Zip commands

zip files

zip <archive.zip> <files-to-compress>
---
unzip archive.zip
unzip archive.zip <file.jpg>
-t test file
-l list files from archive
-j do not make directories

tar files

tar xvf  archive.tar

Z (compressed) files

tar -xZf archive.tar.gz
tar -C /tmp/test archive.tar.gz #extra to /tmp/test (dir must exist)
uncompress archive.tar.gz

Note: z cannot be the last argument, it must come before the f option.

tar.gz files

tar -xzf archive.tar.gz

gzip / .gz files

gunzip archive.gz

bzip2 files

tar xjvf archive.tar.bz2

cheat sheet: http://www.cyberciti.biz/howto/question/general/compress-file-unix-linux-cheat-sheet.php

Advertisements
Tagged with:
Posted in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: