How to Unzip a File in Linux RHEL 6/CentOS 6/CentOS 7

Share this Article :

How to Unzip a File in Linux

File compression can be done in a variety of methods on Linux systems. In Windows you might have come across a utility such as WinZip or Winrar for uncompressing files.

But in Linux you can do it two ways, from Graphical User Interface (GUI) and command line.

As linux system administrator most of the routine task playing with the linux command line. It is quite difficult to remember all the command that have been in use.

Also Read :   How to Upgrade Zimbra Collaboration Suite 8.0.8 to 8.0.9 on CentOS 7.0

In this post, I will show the simple steps on how to unzip a file in Linux and how to zip a folder in Linux Red Hat Linux Enterprise 6 (RHEL 6).

This steps may also working on other versions such as CentOS 5.1, CentOS 5.2, CentOS 5.3, CentOS 5.4, CentOS 5.5, CentOS 5.6, CentOS 5.7, CentOS 6.x, RHEL 5.x and RHEL 6.x. CentOS 7 and Oracle Linux 7.

zip is a compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows, Macintosh and linux operating systems. Meanwhile, unzip is utility to extract compressed files from a ZIP archive.

Also Read :   How to Use Fail2ban to Stop/Prevent SSH Brute Force on Linux

How to zip a folder in Linux

1. Creates the archive and puts all the files in the current directory in it in compressed form as below :

[[email protected] ~]# touch file1
[[email protected] ~]# touch file2
[[email protected] ~]# touch file3
[[email protected] ~]# ls
file1  file2  file3

Then zip folder1 :

[[email protected] ~]# zip folder1 *
  adding: file1 (stored 0%)
  adding: file2 (stored 0%)
  adding: file3 (stored 0%)
[[email protected] ~]# ls
file1  file2  file3

How to Unzip a File in Linux

2. To unzip into /var/www/html/joomla253 folder :

[[email protected] ~]# unzip -d /var/www/html/joomla253

I hope the following tutorial on how to unzip a file in Linux will give you some basic idea on how to zip and unzip a folder on Linux.

Leave a Reply