zip -r myarchive myfolder
- Creates myarchive.zip, an archive containing every files and directories present in myfolder, even files with a starting dot.
zip documents *
zip documents *.sdw
- Creates the documents.zip archive containing all the .sdw files present in the current directory.
zip -r archive * -x \*.doc
- Archives all files and directories in the working directory excluding names with the .doc suffix. Please note the backslashed "*" character to prevent the shell from interpreting it. It will be interpreted and applied by the zip command instead, in all processed directories.
zip -g documents essays/*
- Appends all the files of the essays directory to the existing documents.zip archive.
zip -mT documents *
- Moves all files of the current directory to the documents.zip archive. This is dangerous as this actually deletes those files. Please read the man page for more details.