zip file.zip file1 file2
zip -r file.zip dir1/
unzip file.zip
Let’s say we wanted a single image1.png from our photos.zip.
unzip photos.zip image1.png
What if we want to unzip our files to a different directory (named ./directory/)?
unzip photos.zip -d ./directory/
If you are unsure of the integrity of the zip file and just want to test it, you can use the -t flag.
unzip -t photos.zip
If we wanted to just list the files in a zip file, we can use a simple command.
unzip -l photos.zip