Monday, 14 May 2018

How to zip/unzip the directory in Linux with command line



This article will describe, how to zip and unzip a directory and directory in Linux using command line. Zip is a compression and file packaging utility which is available for Linux, UNIX, Windows and various Operating systems.


Run the following command to check zip utility is installed or not:

[root@linuxcnf ~]#  rpm -q zip
package zip is not installed
package unzip is not installed
[root@linuxcnf ~]# 

If it is not installed in system then follow the link how to install zip and unzip command in Centos 7:

Use the given below command to zip a directory:

[root@linuxcnf ~]# zip -r file-name.zip  /path/to/directory

The directory compressed and zipped with file name file-name.zip.

Run the following command to unzip a zip file:

[root@linuxcnf ~]# unzip file-name.zip

The file-name.zip file will unzip!!!

1 comment:

  1. How to create a file in Linux search takes me here and i found it amazing in reading. Learning is endless and this article is very informative. Thanks to the author for this.

    ReplyDelete