Open zip file in linux

How To Unzip Files in Linux (4 Methods)

Ever found yourself in a situation where you’ve downloaded a zipped file on your Linux system and you’re scratching your head, wondering how to set the contents free? Fear not, brave adventurer! This guide will equip you with not one, not two, but five different ways to unzip files in Linux. By the end of it, you’ll be unzipping files faster than a kangaroo on a trampoline!

We are focusing on the Ubuntu variant in this how to guide however these methods will work with most linux distributions.

Table of Contents

How To Unzip Files Using File Roller

For those who prefer to point and click rather than type, the File Roller (or Archive Manager) is your trusty steed.

  1. Navigate to your zipped file using the file explorer. Navigate to file
  2. Right-click on the file and select ‘Open With Archive Manager’. Open with Archive Manager
  3. Click ‘Extract’. It’s like clicking ‘Open Sesame’ on a treasure chest. Click Extract

How To Unzip Files Using Terminal

Ah, the classic unzip command. It’s like the Swiss Army Knife of unzipping files—always handy, and always gets the job done.

  1. First, you need to open a terminal. Press Ctrl + Alt + T to pop one open. It’s like summoning a genie but for commands. Open Terminal
  2. Navigate to the directory with the zipped file. For example, if your file is in the Downloads directory, type: cd Downloads Navigate to Directory
  3. Now, simply type unzip followed by the zip file name., replacing filename.zip with the name of your file. unzip filename.zip Unzip FileAnd voila! Your file is as free as a bird ! To get a full list of options, just enter unzip on it’s own with no extra options or parameters. Unzip options

How To Unzip Files Using Firefox

Another method that requires no new software is to use firefox browser and our very own ezyZip online unzipper.

  1. Navigate to the zip extractor page on ezyZip.
  2. Select the file zip file you wish to extract. Navigate to ezyZip
  3. Click on the green “Save” button to save files to your desired folder. Select FileRead the full zip extraction instructions on the page itself.
Читайте также:  Linux find sort by date

How To Unzip Files Using 7-Zip

Meet 7-Zip, the Hercules of file compression tools. You’ll need to install it first, though.

  1. First, you need to install 7-Zip. We like the p7zip desktop GUI. Use the following command to install it: sudo snap install p7zip-desktop install p7zip-desktop
  2. Search and open “P7Zip Desktop”. open p7zip desktop
  3. Navigate to the file you wish to extract and click on “Extract” Navigate to Directory
  4. Select your destination folder and click “OK”. Extract FileThat’s all there is to it!

About The Author

Ezriah Zippernowsky

With Ezriah’s expertise, navigating the intricacies of file compression and understanding the functionalities of archiving becomes a breeze. From crafting step-by-step tutorials to creating in-depth videos, Ezriah brings complex technical concepts to life, making them accessible to users of all levels of expertise. Ezriah represents the collective wisdom of the entire ezyZip team.

Источник

How To Unzip A File In Linux | Unzip Syntax | 8 Unzip Commands

How To Unzip A File In Linux | Unzip Syntax | 8 Unzip Commands

If you have a compressed zip file, you can unzip it using the Linux command line. Linux’s unzip command is highly flexible just like zip commands and can be used for much more than simply extracting zip files. Files from a ZIP archive, which are often seen on MS-DOS computers, can be listed, tested, or extracted using Unzip. If no settings are provided, the default behavior i.e. with no options will extract all files from the supplied ZIP archive into the current file and all subdirectories beneath it.

Unzip syntax

First of all, you need to install the unzip package. To do so, type in a terminal command:

sudo apt-get install unzip

Once all the packets have been installed, to unzip the archive files type in a terminal command:

A more useful tool is 7z, which zips and unzips a range of compression formats, notably lzma, usually the protocol offering the highest compression rates.

sudo apt-get install p7zip-full

Extract the zip file with Linux

  1. Open the Files app and navigate to the directory where the zip file is located.
  2. Locate the file which you want to unzip.
  3. Right-click on the file and the context menu will appear with the list of options.
  4. Select the “Extract Here” option to unzip files into the present working directory or choose “Extract to. ” for a different directory.

Unzip arguments in Linux

Some of the most commonly used arguments by unzip are listed below:

It tells the path of the zip archive(s). When a wildcard is used in the file specification, the operating system chooses the order in which each matching file is processed (or file system). The path itself cannot be a wildcard; only the filename can.

Читайте также:  Check all environment variables linux

A list of archive members to process that can be optional, delimited by spaces. (VMS versions that have VMSCLI specified during compilation had to delimit files using commas. (For further information, see -v in the section below that lists your options.) You can match several members using regular expressions (wildcards).

An optional list of archive members to be excluded from processing. This option can be used to exclude any files that are in subdirectories because wildcard characters often match (‘/’) directory separators (for exceptions see the option -W).

If specified, files will be extracted to the target directory exdir. By default, all files and subdirectories are recreated in the current directory; the -d option allows extraction in an arbitrary directory (always assuming one has permission to write to the current working directory). This option need not appear at the end of the command line; it is also accepted before the zip file specification (with the normal options), immediately after the zip file path, or between the file(s) and the -x option.

Unzip commands/Options in Linux

To unzip a file, you do not need to add any options like the zip command. With unzip, the default behavior is to always seek permission before overwriting current files. Using unzip, you can extract every letter from the archive. Create any necessary subdirectories, then unzip into the current directory and any subdirectories below it options and commands that unzip accepts and uses are:

1. Unzip a file to a different directory

To unzip a ZIP file to a different directory than the current folder, we use the -D (Directory) Option. Go to the file manager and click on the zip file you want to unzip. Now open the terminal window and run the following command:

Command: $ unzip filename.zip -d /path/to/directory

2. Unzip tar/tar.gz/tgz files to a specific directory

Most files in Linux are compressed using the tar format. A .tar file is a collection of uncompressed files, sometimes known as a tarball. Since .tar doesn’t compress anything, it requires a separate compression utility for compression. The tar command allows you to create tar archive files as well as decompress them. This technique can be used on other file types/ file formats also. Using tar UtilityA tar.gz file is a combination of a .tar file and a .gz file. By default, the tar command will extract files to your current directory. Go to the terminal window and run the following command:

Command: $ tar -xf file-name.tar -C /path/to/directory

The -x option tells tar to extract the files. You can also use xargs with tar to create a tar.gz archive and populate it with files from the find command. Note: Some graphical interfaces include a tool for managing tar.gz files without the command line. Working with the graphical interface is a little difficult task.

Читайте также:  Dns server administration in linux

3. Unzip a password-protected zip file

To unzip a file that is password-protected, invoke the unzip command with the -P option i.e -P (Password) Option followed by the password:

Command: $ unzip -P PasswOrd filename.zip

4. Exclude Files when Unzipping a ZIP File

To exclude specific files or directories from being extracted, use the -X (Exclude) option in the terminal :

Command: $ unzip filename.zip -x file1-to-exclude file2-to-exclude

5. Suppress the Output of the unzip Command

By default, unzip prints the names of all the files it’s extracting and a summary when the extraction is completed. Use the -q switch to suppress the printing of these messages.

Command: $ unzip -q filename.zip

6. Overwrite existing files

If you want to overwrite existing files without prompting, it can be done using the -o option. To run the -o (overwrite) option open the terminal window and run the following command:

Command: $ unzip -o filename.zip

7. Unzip a zip file without overwriting existing files

This command can be performed using the -n option which forces unzip to skip the extraction of a file that already exists:

Command: $ unzip -n filename.zip

8. List the Contents of a zip file

To list the contents of a given zip file we use the -l (list archive) option. To execute the -l option to the current file, open the windows terminal and type the following command:

Command: $ unzip -l filename.zip

Summary

The unzip utility is an extremely effective and straightforward tool for transferring compressed files over a network or even between operating systems. From the above tutorial, you can easily unzip files in Linux systems through the command line using the unzip command.

Suggested reads:

Shivangi Vatsal

I am a storyteller by nature. At Unstop, I tell stories ripe with promise and inspiration, and in life, I voice out the stories of our four-legged furry friends. Providing a prospect of a good life filled with equal opportunities to students and our pawsome buddies helps me sleep better at night. And for those rainy evenings, I turn to my colors.

Источник

Оцените статью
Adblock
detector