Zip In Terminal ( MacOS )

zip -r myfiles.zip mydirectory

Explanation

  • zip is the command
  • -r means recursive
  • Third argument is your custom-named zip file
  • Fourth argument is the directory and/or files you want zipped

Other Arguments

  • The dot “.” symbol refers to the directory you are currently in
  • The asterisk/star “*” symbol means all/everything

A Multitude of Zips

zip -r myfiles mydirectory

or

zip -r myfiles.zip mydirectory

or

zip -r myfiles mydirectory/*

or

zip -r myfiles.zip mydirectory/*

or

zip -r myfiles .

or

zip -r myfiles.zip .

Result

myfiles.zip

Back To TIL