--- layout: page category-page: fs category-title: FileSystem tags: compress file directory extract author: Joao Tomazoni title: zip previous-page: pages/fs/rm.html --- zip is the command to package and compress files together as .zip extension. Simply type zip + name of the zip file + name of the files to be compressed as .zip.
zip -r [target.zip] [source1] [source2]
Say you want to compress a file named test.txt and an image named image.png together in one zip file named test.zip. This is what it should look like:
zip -r test.zip text.txt image.png
In this case it should return a test.zip file in your desktop with a directory inside containing the two files together.

Flags