All File zipping commands in Linux

All File/Folder Zipping and unzipping commands in Linux

Command to create new zip file
the below command will create a new zip file names and add the image.jpg file to zip archive.
[root@server ~#]zip image.jpg 

How to add more than one files to a zip file
Will add the two files images.jpg and photo.jpg to
[root@server ~#]zip image.jpg photo.jpg   

Add a folder to zip file
Here all the contents in the "Datas" will add to the new zip file ""
[root@server ~#]zip -r Datas/

Add a file to an existing zip file
All the above commands can be used to add new file(s) or folder(s) to an existing zip file If the the specified zip file already exists.

How to Unzip a zip file
[root@server ~#]unzip          (unzips the contents to the current directory)

Unzip only a single file from the zip archieve. 
[root@server ~#]unzip photo.jpg     (unzip only photo.jpg from

Unzip all the files to a specified directory
[root@server ~#]unzip -d /new/pics/

List contents in a zip file
[root@server ~#]unzip -l

Check compressing errors in zip file
[root@server ~#]unzip -tq

Was this helpfull ?


Related Posts Plugin for WordPress, Blogger...

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons