Command to create new zip file
the below command will create a new zip file names images.zip and add the image.jpg file to zip archive.
[root@server ~#]zip images.zip image.jpg
Will add the two files images.jpg and photo.jpg to images.zip
[root@server ~#]zip images.zip image.jpg photo.jpg
Here all the contents in the "Datas" will add to the new zip file "Datas.zip"
[root@server ~#]zip -r Datas.zip Datas/
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 images.zip (unzips the contents to the current directory)
Unzip only a single file from the zip archieve.
[root@server ~#]unzip images.zip photo.jpg (unzip only photo.jpg from images.zip)
Unzip all the files to a specified directory
[root@server ~#]unzip images.zip -d /new/pics/
List contents in a zip file
[root@server ~#]unzip -l images.zip
Check compressing errors in zip file
[root@server ~#]unzip -tq images.zip
0 comments:
Post a Comment