

This will extract the compressed file from the archive and decompress it so that it is indistinguishable from the original file. To decompress a GZ archive file, use the -d (decompress) option. This time the original ODS file is retained. gzip -k calc-sheet.ods ls -lh calc-sheet.* But if you prefer to retain the original file, you can use the -k (keep) option. If you need the original file you can retrieve it from the archive file. We hope you found this guide on how to unzip a file in Linux valuable and that going forward, you will be able to unzip files without a hitch.That’s not an issue. And this draws the curtain to our tutorial. As you have seen unzipping files is quite a breeze and not complex. In this tutorial, we walked you through the process of unzipping archive files using the unzip command. If you leave them out, you will certainly get an error. Take extra note of the single quotes ” around the wildcard. If you have several zipped files and you want to unzip them all at the same time, use the wildcard symbol as shown in the syntax below. Unzip multiple archive files simultaneously

This way, you will overwrite the file without any prompts. However, to simplify this, simply pass the -o flag to overwrite the current file without being prompted on the terminal.

Naturally, you would press ‘y’ for yes to overwrite the current file with the new one. When this happens, you will be prompted whether you want to overwrite the file, skip the extraction, rename of skip the extraction of all files as indicated. Suppose you have already unzipped your files and you are once again, running the command again. $ unzip archive.zip -x file1 file2 file3 Overwrite a file while unzipping To accomplish this fete, use the -x switch followed by the list of files to be excluded separated by a space. Once you have an overview of the contents of the archive file, you may wish to exclude some files from being unzipped. $ unzip -l archive.zip Exclude a file when unzipping If you have no clue or are unsure about the contents of an archive but wish to list what’s contained therein, use the -l option (For list) to give you a summary of the contents of the zipped file. $ unzip -q nextcloud-19.0.3.zip List contents of a zipped file CentOS / RHELįor RHEL & CentOS flavors and their derivatives, run the following command: $ sudo yum install unzip Ubuntu / Debianįor Debian / Ubuntu variants, invoke the command: In its most basic form, the syntax for unzipping an archive file is as shown: $ unzip archive.zip Installing unzip in Linuxīefore we proceed to show you how to unzip files or directories, we need to point out that while the unzip command-line tool comes preinstalled in most modern systems, it is not native to some distributions. On the terminal, the command-line utility used for unzipping files from an archive is the unzip command. Having discussed a little bit about zipping and unzipping files, let’s now roll our sleeves and see how you can unzip files. In this guide, we will see how you can unzip a file in Linux. It decompresses the file allowing you to access its contents. Zipping a file comes recommended when uploading the file/directory or sending it via email. Zipping a file or directory is a popular practice when you want to send a huge file that seemingly takes up a lot of space.
