zip and unzip commands in Linux

  1. extract a zip file to a specific folder
  2. Zip everything in current directory
  3. View list of files in ZIP archive

extract a zip file to a specific folder

  1. Now create a temporary folder to extract the file:
1
mkdir temp_for_zip_extract
  1. Extract the zip file into that folder:
1
unzip /path/to/file.zip -d temp_for_zip_extract

Zip everything in current directory

1
zip -r foo.zip .

View list of files in ZIP archive

1
unzip -l files.zip