
Compressing/Decompressing files in Linux
July 7, 2007The first thing that we must know, it’s to Compress/Decompress we need some applications, like “unzip” or “unrar”. All of them can be installed using “apt-get” or downloading it from their respective project pages. To find them, can use google
.
But, to compress/decompress we’ll use some commands. I did this table with any (the most important, i think) u/d commands.
|
.tar.gz (Tar + Gzip) |
|
| Pack and compress | tar czvf file.tar.gz /folder1/subfolder/* |
| Unpack and decompress | tar xzvf file.tar.gz |
| To view data | tar tzvf file.tar.gz |
|
.tar (Tar) |
|
| Pack and compress | tar cvf file.tar / folder1/ subfolder /* |
| Unpack and decompress | tar xvf file.tar |
| To view data | ttar tvf file.tar |
|
.bz2 (Bzip2) |
|
| Compress | bzip2 file |
| Decompress | bzip2 -d file.bz2 |
|
.zip (Zip) |
|
| Compress | zip file.zip /folder1/subfolder |
| Decompress | unzip file.zip |
| To view data | unzip -v file.zip |
|
.rar (Rar) |
|
| Compress | rar -a file.rar /folder1/subfolder |
| Decompress | rar -x file.rar |
| To view data | rar -v file.rar |
Thanks for providing all compressing and uncompressing commands at a single place. They are pretty useful.I appreciate that.