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

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).

Example:

  • $ tar xvf archivo.tar
Gz

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.

Example:

  • $ gzip -d archivo.gz
  • $ gunzip archivo.gz
Tar.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.

Example:

  • $tar xvzf archivo.tar.gz
Bz2

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.

Example:

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

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

Example:

  • $ tar xvjf archivo.tar.bz2
Zip

Zip compressed file. Decompressed using the command unzip:

  • $ unzip archivo.zip
Rar

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).

Example:
  • $ rar -x archivo.rar
7zip

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
Share:

No comments:

Post a Comment

Popular Posts

Labels

Labels

Blog Archive

Recent Posts

Pages

Recent Comments

Top Commenters

Followers