Unzip Files in Linux
In Windows you might have come across a utility such as WinZip for uncompressing files . But in Linux you can do it 2 ways , from command line and using the GUI ( Graphical User Interface) .
Contents
Steps
Graphical Method
- If you are using GNOME, you could use File roller, which is the default archive manager and it lets you zip and unzip archives graphically.
- If you are on KDE ,try using ark or Karchive.
Command Line
- Install zip and unzip tools. Linux has both zip and unzip programs. But in most linux distributions these utilities are not installed by default. To install go to a command prompt, such as a terminal and follow the instructions below.
- If you are using Debian Based linux distributions , after becoming root user,type the two commands to install zip and unzip program.
apt-get install zip
apt-get install unzip. - If you are Red Hat Linux/Fedora user then you can use yum command to install zip and unzip program.
yum install zip unzip.
Zipping a file
- Navigate to directory which you wish to compress and type in
zip data *
Replace the the data with a title for your zip file. - If you wish to zip up an entire directory , navigate to your directory and use the following command.
zip -r data *.
Unzipping an archive file
- Unzip is used to extract all the files of a zip archive to your current directory .
unzip data.zip. - You could also test the .zip file ( ie make sure its ok or not) by the following command .The command prints a summary message indicating whether it is usable or broken.
unzip -tq data.zip. - To extract an individual file from a zip archive: (Let us suppose the name of the file as wiki.txt)
unzip data.zip wiki.txt. - Extract all files of the zip into the /tmp directory.
unzip data.zip -d /tmp. - List the files of the archive without unzipping them.
unzip -l data.zip
Tips
- There are other graphical archive managers such as x archive, squeeze etc which may be available in your repos.
Related Articles
- Use Amarok Media Player
- Set up a Wireless Network in Linux
- Unrar Files in Linux
- Install Software in Debian Linux
- Make a Zip File in Linux
- Edit an Image in digiKam