FizzBuzz Journal

Not really a blog, just some stuff that a future me might need to remember one day.

  1. Github
  2. Stackoverflow
  3. Twitter

Using zip and unzip from the command line

07 Jul 2016

More remedial Unix command line.

Zip

For a single file it’s just:

$ zip archive.zip file_to_archive

More than one file?:

$ zip archive.zip file_to_archive another_file_to_archive

To zip a set of files in a given directory:

$ zip folder.zip folder/*

What if it’s a big nested tree of directories and files?

$ zip folder.zip folder/**/*

Unzip

To just look at the context of the zip file just use the -l option:

$ unzip -l archive.zip

To go ahead and unzip the whole archive to the current directory it’s just:

$ unzip archive.zip

To unzip the whole archive into a different directory (creating it if necessary):

$ unzip archive.zip -d somewhere_else