How to unzip files in Ubuntu

unzip Zip files

Although many users think that a Gnu / Linux distribution and systems like Windows have nothing in common, the truth is that they do. Both operating systems have certain elements in common such as the type of files that can be viewed or the management of computer files.

In these respects, Gnu / Linux has the same as Windows but in a different way. One of the types of files that offer the most problems to the novice user in Gnu / Linux the compressed file and its ways of working. Thus, to decompress files in Gnu / Linux we need programs that do it and certain commands to compress or decompress files. But first of all, let's first see what compressed files are.

What are compressed files?

The compressed files are computer files that are characterized by occupying less space on the hard disk than the files are within these files. Thus, compressed files are used and ideal for places where you need to save space. The compressed files are in a different format than the original format and are not accessible by any program except the compressor program that will be in charge of decompressing in order to run and view the compressed files.

In Gnu / Linux we can find compressed files in the programs that the repositories send us, when we download the program packages and even when we install program packages, since the different package formats are still a type of compressed files that do not need any compressor program to run.

Within the Gnu / Linux operating systems, we find various compressed file formats that can be used from the start, but some others require a compressor program and another decompressor program. In general, all programs that are compressors allow us to decompress the file and therefore no more than one program is needed to manage these types of files and there are even programs that manage different types of compressed files.

How to install compressors in Gnu / Linux?

There are several types of compressed files that any distribution can handle from the first second. Tar, tar.gz and their derivatives are compressed files that can be used, but they are not the most popular among computer systems, with .zip and rar being the preferred and most popular file formats. But no distribution has the compressor for this type of files or specific types of compressed files installed by default, therefore, after installing the distribution we have to execute the following in the terminal:

sudo apt-get install rar unrar unace zip unzip p7zip-full p7zip-rar sharutils mpack arj cabextract file-roller uudeview

Esto if we use a Gnu / Linux distribution based on Ubuntu or Debian. If on the contrary, we did not have Ubuntu and we used a distribution based on Fedora or Red Hat, we have to write the following:

sudo dnf install rar unrar unace zip unzip p7zip-full p7zip-rar sharutils mpack arj cabextract file-roller uudeview

If we don't have Ubuntu and we have Arch Linux or its derivatives, then we have to write the following:

Pacman -S rar unrar unace zip unzip p7zip-full p7zip-rar sharutils mpack arj cabextract file-roller uudeview

This method is through a terminal but we can also do it through a graphical software manager. In this case, we have to look for compressors related to the .zip, rar, ace and arj formats. All distributions have graphical software managers with a browser, so the graphical installation will be a quick and easy procedure. Once we have them installed, the file manager will change as well as the application menu and context menus.

How to use them in the terminal?

The process of use with the Gnu / Linux terminal is very easy and simple. In general we can say that to compress files we have to execute the compressor command followed by the name of the compressed file that we will create and the files that we want to compress.

So, to compress a file into zip format we have to use the following pattern:

zip archivo.zip archivo.doc archivo.jpg

If we want to create a file in gzip format, the pattern will be as follows:

gzip archivo.doc

If we want to create a file in tar format, then we have to write the following:

tar -zcvf archivo.tgz archivo.doc

unzip to rar on ubuntu

We have to carry out a similar process when we want to decompress files through the terminal. For this we have to follow the same patterns but changing the command to be executed. Thus, for unzip files in .zip format we have to write:

unzip archivo.zip

If we want to unzip files in .rar format we have to write:

unrar archivo.rar

If we want to unzip files in tar format, then we have to execute the following:

tar -zxvf archivo.tgz

If the file is in gzip format, then we have to execute the following:

gzip -d archivo.zip

There are other compressed file formats that can be installed and used through the terminal. In general these compressors follow the same pattern and if not, it will always appear in the repository's man page, a very useful page to have information about the program that we will use.

How to use them graphically?

The creation of compressed files in our distribution graphically is quite simple. When installing the previous compressors, the file manager has been modified. Thus, in the contextual menu that appears when we do double click on a file you will have the option to Compress…. Selecting this option will bring up a window like the following:

Compress files

In it we enter the name of the new file and mark the type of compression we want to perform. That is, if it will be compressed in .zip, tar.xz, rar, .7z, etc ...

The process for decompressing files graphically in Gnu / Linux is even easier than through the terminal itself. We double click on the compressed file and a window will appear with all the documents that the file contains. If we double click on any of these documents it will be displayed temporarily, if we want to unzip the file then we mark it and then we press the extract button. As well we can unzip all the files by pressing the "Extract" button directly, but we have to make sure that no file is marked or selected.

Unzip files

Can this only be done with compressed files?

The truth is that no. There are many other operations we can do with compressed files. Not only can we unzip files or create them but we can also encrypt them or we can simply create multiple files of a specific size and join them to create a single compressed file.
But these operations they are more complicated to carry out and it is not essential to work with these types of files, with the above commands and guides it is more than enough to work with compressed files in an efficient and productive way.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Francisco Antonio Nocetti Anziani said

    $ sudo apt-get install ark
    then right click on the file, open with ark and extract 🙂

  2.   munari said

    For those who have Ubuntu or Fedora (it comes by default)
    in terminal write:
    unp
    unp extracts one or more files given as command line arguments:
    $ unp file.tar
    $ unp file.bz2 file.rpm file.dat file.lzip

    Supported formats:

    $unp -s
    Known archive formats and tools:
    7z: p7zip or p7zip-full
    ace: unace
    ar, deb: binutils
    arj: arj
    bz2: bzip2
    cab: ​​cabextract
    chm: libchm-bin or archmage
    cpio, year: cpio or year
    dat: tnef
    dms: xdms
    exe: maybe orange or unzip or unrar or unarj or lha
    gz: gzip
    hqx: macutils
    lha, lzh: lha
    lz: lzip
    lzma: xz-utils or lzma
    lzo: lzop
    lzx: unlzx
    mbox: formail and mpack
    pmd: ppmd
    rar: rar or unrar or unrar-free
    rpm: rpm2cpio and cpio
    sea, sea.bin: macutils
    shar: sharutils
    tar: tar
    tar.bz2, tbz2: tar with bzip2
    tar.lzip: tar with lzip
    tar.lzop, tzo: tar with lzop
    tar.xz, txz: tar with xz-utils
    tar.z: tar with compress
    tgz, tar.gz: tar with gzip
    uu: sharutils
    xz: xz-utils
    Negative repeat count does nothing at / usr / bin / unp line 317.
    zip, cbz, cbr, jar, war, ear, xpi, adf: unzip
    zoo: zoo

  3.   Swamp said

    to unzip tar files, tar -zxvf file.tgz ??
    I think only -xvf is enough

  4.   Night Vampire said

    Someone to do a tutorial on how to install PeaZip on Ubuntu and other distros and how to integrate it with Gnome and Plasma 5, thanks.

  5.   alejonet said

    Thanks I unzip document with pass in an installation ubuntu 18

  6.   Lord_Chendho said

    Good tuto but it would be much better if the compressors could make use of the multithreading. I have to unzip 4gb files and it takes a long time on a ryzen 5 1600x. With htop I have been able to observe that the performance is very low because it uses a single cpu.