Zipping Files and Directories with zip

If you’re working with files and directories that will be accessed on the Windows platform, you might need to use zip (rather than gzip). This zip is like DOS or Windows zip, so it’s a safer option than gzip, which can work, but it depends on the software available on the Windows system. zip files are compressed to save disk space and sometimes contain multiple files (see Code Listing 13.12).

To Zip Files or Directories with zip:

1.
ls -l z* At the shell prompt, use ls -l to confirm the names of the files or directories you want to zip.
2.
zip -r zipped zipadeedoodah Type zip -r followed by the name of the zip file you’re creating (without an extension), followed by the name of the file or directory ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.