Skip to content

Instantly share code, notes, and snippets.

@fahimbabarpatel
Created December 22, 2015 14:04
Show Gist options
  • Save fahimbabarpatel/d3e8b5c40a9db2ea5724 to your computer and use it in GitHub Desktop.
Save fahimbabarpatel/d3e8b5c40a9db2ea5724 to your computer and use it in GitHub Desktop.

Zip

zip file.zip file1 file2
zip -r file.zip dir1/

UnZip

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment