Thursday, October 14, 2010

Tip: How to unzip files on Linux

To unzip files in graphical mode, users of GNU/Linux have several tools and file manager that we make the task easier. But to perform these tasks from the console, first chance we have to know how to treat each of these files.

Let's look at how you extract individual files compressed or packaged in Linux from the console.


Tar is a file format used in Unix environments that are identified with the tar extension. The tar program is used to store files and directories in a single file. To extract it from the console, we run the tar command with their respective options: x (extract) f (from file), and optionally v (see what is done).


  • $ tar xvf archivo.tar

GNU zip or gzip is a compressed file type is typical of Unix systems. To decompress, we do with the gzip command and their options: -d (decompress) , -f (force). Or use the gunzip command, which is a link to gzip.


  • $ gzip -d archivo.gz
  • $ gunzip archivo.gz

Is very common to see Linux files packaged with tar and compressed with gzip (.Tar.gz). To decompress, we do the same way as a tar file, but adding the z option to tell the program to use gzip to decompress.


  • $tar xvzf archivo.tar.gz

Atchivo is a type of compressed with bzip2. The syntax is similar to gzip program. To decompress bzip2 command is used with the -d (decompress), or the bunzip2 command, which is only a link to bzip2.


  • $ bzip2 -d archivo.bz2
  • $ bunzip2 archivo.bz2

Similar to the tar.gz file, but used bzip2 to compress. To decompress tar is also used, with the option j.


  • $ tar xvjf archivo.tar.bz2

Zip compressed file. Decompressed using the command unzip:

  • $ unzip

Proprietary format developed by the creators of the famous Winrar. In most cases, the rar command is not installed on your system. For this tipeamos following in console:

  • $ sudo aptitude install rar (In Debian / Ubuntu)
  • $ yum install unrar (In Fedora)
To decompress, we do with the -x (extract).

  • $ rar -x archivo.rar

A data compression format free. To use it, we install the following package:

  • $ sudo apt-get install p7zip (In Debian / Ubuntu)
  • $ yum install p7zip (In Fedora)
To compress:
  • $ p7zip nombre_archivo
To decompress:
  • $ p7zip -d nombre_archivo.7z
If this article was useful and you want to help us to grow Subscribing to our feed or Click "Like" in our Facebook page ,or follow us via Twitter or subscribing to our feed.

People who read this post also read :


Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More