Data Compression with ZIP command

ZIP command with examples


ZIP command is used to compress a huge file. It will be very useful in the time of data transfer between two systems. If space in the partition seems to be very less means you can use command to compress it.



#zipĀ  <options> <> <sourcefilename>


To zip a single file
#zip hello


To zip 4 individual files

#zip a.txt b.txt c.txt d.txt


To zip an entire directory

#zip -r testfolder


To assign password for zip file
#zip -e hi.txt


To compress at Level 9, level 9 is max compressionĀ 

#zip -9 /var/www/*


Zip entire folder with full compression.

#zip -9 -r public_html1


To find out what are the files present in the a zip file


To encrypt and set password for the zip file