How do I zip a file in Terminal?

How do I zip a file in Terminal?
Answer
How to Zip a Folder Using Terminal or Command Line
  1. SSH into your website root via Terminal (on Mac) or your command line tool of choice.
  2. Navigate to the parent folder of the folder that you want to zip up using the “cd” command.
  3. Use the following command: zip -r mynewfilename.zip foldertozip/ or tar -pvczf BackUpDirectory.tar.gz /path/to/directory for gzip compression.
 

Tìm kiếm

Back
Top