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.
In this post, I will show the simple steps on how to unzip a file in Linux and how to zip the file in 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.
How to zip files in Linux
1. Creates the archive folder1.zip 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
[[email protected] ~]# zip folder1 * adding: file1 (stored 0%) adding: file2 (stored 0%) adding: file3 (stored 0%) [[email protected] ~]# ls file1 file2 file3 folder1.zip
How to Unzip a File in Linux
2. To unzip Joomla_2.5.3-Stable-Full_Package.zip into /var/www/html/joomla253 folder :
[[email protected] ~]# unzip Joomla_2.5.3-Stable-Full_Package.zip -d /var/www/html/joomla253
I hope the following simple steps on how to unzip a file in Linux give you some basic idea how do zip and unzip.
Like this Article? Subscribe to Our Feed!
This article was posted on Friday, March 23, 2012 at 8:53 PM