How to unzip files in Linux

Author: Helen Garcia
Date Of Creation: 19 April 2021
Update Date: 1 July 2024
Anonim
How to Zip and Unzip Directories on Linux
Video: How to Zip and Unzip Directories on Linux

Content

Roshal ARchive (RAR) is a file format designed for compressing and archiving data. After downloading RAR files from the Internet, you will need a program that will extract them - unzip or unzip them. Since this program is not preinstalled on most Linux systems, you need to install it yourself. This tutorial explains where to get unrar (unzip program) and how to use it on Linux.

Steps

Method 1 of 2: Installing Unrar Program

  1. 1 Make sure your computer is connected to the Internet.
  2. 2 If you are in the Linux graphical user interface, open a Linux shell.
    • The command shell can be opened using the following keyboard shortcut: Control + ALT + F1.
    • Also, in the Utilities folder, you can open Terminal, which performs the same functions as the command shell.
    • All of the following commands can be entered from the Linux command shell or Terminal.
  3. 3 Use the appropriate command to download unrar for installation on Linux. The following commands require superuser privileges, so you need to login using su (or sudo). Enter your username and password to log in as superuser.
    • Debian Linux users should enter the following command: “apt-get install unrar” or “apt-get install unrar-free”.
    • If you are using Fedora Core Linux, enter the following command: “yum install unrar”.
    • Arch Linux users should install from the additional repository "pacman -S unrar".
    • OpenBSD users enter the command: “pkg_add –v –r unrar”.
    • Suse10 users can enter “yast2 –i unrar”.
    • Suse11 users can enter “zypper install unrar”.
  4. 4 If the above commands don't work, download the binary package directly from rarlab.
    • Type “cd / tmp”.
    • Enter “wget http://www.rarlab.com/rar/rarlinux-3.9.1.tar.gz”.
    • Unzip the file with the following command: “tar -zxvf rarlinux-3.9.1.tar.gz”.
  5. 5 Find the rar and unrar commands in the rar directory.
    • Enter “cd rar”.
    • Type “./unrar”.
  6. 6 Copy rar and unrar to / usr / local / bin directory with the following command: “Cp rar unrar / usr / local / bin”. The unrar command is now ready for use on your Linux system.

Method 2 of 2: Using the Unrar Program

  1. 1 Dump all files (no folder) in the current directory using the “unrar e file.rar” command.
  2. 2 Create a list of files in RAR archives using the “unrar l file.rar” command.
  3. 3 Extract files with full path using “unrar x file.rar” command. This is probably what you wanted.
  4. 4 Check the integrity of the archive using the “unrar t file.rar” command.

Tips

  • If you are uncomfortable using the command line and are looking for a RAR with a user interface to install on Linux, try PeaZip. PeaZip works in Gnome and KDE, and is also available in DEB or RPM.
  • RAR3 is the current version of the RAR format. It adds an advanced 128-bit key encryption standard. It also supports files over 5 gigabytes and Unicode file names.
  • If the RAR file is split into smaller files, they will be named .rar, .r00, .r01, etc. Tell your unrar program the location of the .rar file and it will automatically reassemble all the pieces.
  • RAR files can only be created using paid software, but you can use the free command line tool unrar for Linux to unzip.
  • The RAR format supports data compression, error elimination, and the ability to split large files into smaller ones for future connection.
  • The File Roller (the standard archive manager on Gnome-based distributions) can use the unrar tool launched from the command line. Install unrar to / usr / local / bin / (or equivalent) and File Roller will automatically use it to open and extract rar files.

Warnings

  • If you get an error while installing the unrar command, log in as superuser by entering “sudo -s” and your password. This will give you the correct installation rights.