UNIX: zip file or directory

/ Published in: Bash
Save to your folder(s)

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.

Copy this code and paste it in your HTML
  1. # to choose individual files to include in the zip
  2. zip filename inputfile1 inputfile2
  4. # To include the contents of a directory or directories in a zip archive, use the -r flag:
  5. zip -r filename directory
  7. #or
  9. zip -r filename *

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.