How to unpack rar, zip, tar.gz, bz2, tar.bz2 (Ubuntu)

Here are some commands that you can use via the terminal to extract the contents of the various archive file formats:

zip:
root@penreturns:~$ gunzip file_name.zip
rar:

First install "unrar" with this command:


root@penreturns:~$ sudo apt-get install unrar
Use now this command to unpack rar files:
root@penreturns:~$ unrar x file_name.rar
tar:
root@penreturns:~$ tar -xvf file_name.tar
tar.gz:
root@penreturns:~$ tar -vzxf file_name.tar.gz
bz2:
root@penreturns:~$ bunzip file_name.bz2
tar.bz2:
root@penreturns:~$ tar -jxvf file_name.tar.bz2

Enjoy!

*copy code without root@penreturns:~$ 

Reply to this post

Post a Comment