To install zip
$ sudo apt install zip
To zip a single file file1.txt
$ zip file1.zip file1.txt
To zip multiple files
$ zip file.zip file1.txt file2.txt file3.txt file4.txt
To zip files based on wildcard
$ zip txt_file,zip *.txt
$ zip mp3_file.zip *.mp3
$ zip jpg_file.zip *.jpg
To zip a file to a different directory
$ zip /path/to/dir/file.zip file1.txt file2.txt file3.txt
To add a file to a existing zip file
$ zip -u file.zip file5.txt
To remove a file from an already existing zip file
$ zip -d files.zip file5.txt
To delete the original files after creating the zipped file
$ zip -m file.zip file1.txt file2.txt file3.txt
To zip directories
$ zip -r mydir.zip dir1/
To set the level of compression
compression ranges from 0 to 9 level
default is 6
files with compression value 9 is less in file as compared to compression value 0
To compress a file using compression value 9
$ zip -9 files9.zip *.txt
To compress a file using compression value 0
$ zip -0 file0.zip *.txt
To create password-protected zip files
$ zip -e files.zip *.txt
To set a password to a zip file at any time
$ zipcloak file.zip
To display details about the zipped file
$ zipdetails file.zip
To search files inside the zip file file.zip the word ipaddress
$ zipgrep ipaddress file.zip
To display information about the zip file
$ zipinfo file.zip
To split the zip file
$ zipsplit -n <size> test.zip
<size> is the maximum size for the split files
To get help info
$ zip --help
regards,
T.Dhanasekar