zip and unzip command in linux

Here, I have described about zip & unzip commands in Linux environment. Please look on the given below zip command.

Zip Command:

$ zip option zip-filename directory-path-or-file-name


1- Create a zip of single file.

$ zip file-name

2- Create a zip of directory of files.

$ zip -r directory-path

3- Create a zip by excluding some specific directory & sub-directory.

$ zip  -r  directory-path  -x exclude-dir1/**\*  exclude-dir2/**\*

4- Create password protected zip.

$ zip -p password file-name

Unzip command:

$ unzip

1- Extract a ZIP File into a Different Directory.

$ unzip -d directory-path

2- Show Content of zip file.

$ unzip -l

3- Check zip is valid or  not.

$ unzip -t

4- Extract password protected zip file.

$ unzip -P password

Leave a Reply

Your email address will not be published. Required fields are marked *