Never Ending Security

It starts all here

Compressing / Uncompressing Cheatsheet


A Couple of Examples and Usage Cases for Dealing with Compressing and Uncompressing Files:

TAR – (Tape Archive)

Compressing / Creating / Uncompressing


c – create a new archive
v – be verbose
f – following is the name of the archive
z – filter using gzip
j – filter using bzip2
x – extract files from archive
r – add another file to an archive

Create a Tar archive-

tar cvf nameofarchive.tar [/path/to/dir/]

Create a Tar thats been gzipped-

tar cvfz nameofarchive.tar.gz [/path/to/dir/]

Create a Tar thats been bzipped-

tar cvfj nameofarchive.tar.bz2 [/path/to/dir/]

Extracting a Tar archive(untar)-

tar xvf nameofarchive.tar [/path/to/dir/]

Extracting a gzipped tar archive-

tar xvfz nameofarchive.tar.gz

Extracting a bzipped tar archive-

tar xvfj nameofarchive.tar.bz2

Add a file to a tar archive(Only works on non-compressed)-

tar rvf nameofarchive.tar [/path/to/new/file]

ZIP – (ZIP Archive)

zipping / unzipping

Create a zip archive-

zip nameofarchive [/path/to/file]

Create a zip of an entire directory-

zip -r nameofarchive [/path/to/dir/]

Extract all files from a zip(unzip)-


RAR – (Roshal Archive)



a – create a rar archive
d – delete a file
r – recover a deleted file
u – update / add
a -p – Set password
l – lock
e – extract file from rar archive
x – extract but retain directory sturcture
l – list a files
t – test files in rar archive

Create a rar archive-

rar a nameofarchive.rar [/path/to/dir]

Extract all the contents of a rar-

unrar e nameofarchive.rar

Extract to a specific directory-

unrar e nameofarchive.rar [/path/to/extract/to/]

Set a password on a rar archive-

rar a -p nameofarchive.rar


Leave a Reply

Please log in using one of these methods to post your comment: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s