zip file through command line mac code example Example: zip folder terminal zip -r mynewfilename.zip foldertozip/