Posted By

beneberle on 07/02/10


Tagged

unix


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Vordreller
tribal


UNIX: zip file or directory


 / Published in: Bash
 

Replace filename with the name you want to give the zip file. The .zip extension is automatically appended to the end of the filename. Replace inputfile1 and inputfile2 with the names of the files you wish to include in the zip archive. You can include any number of files here, or you may use an asterisk (*) to include all files in the current directory.

  1. # to choose individual files to include in the zip
  2. zip filename inputfile1 inputfile2
  3.  
  4. # To include the contents of a directory or directories in a zip archive, use the -r flag:
  5. zip -r filename directory
  6.  
  7. #or
  8.  
  9. zip -r filename *

Report this snippet  

You need to login to post a comment.