If the file list is specified as -@, [Not on MacOS] zip takes the list of input files from standard input.
Under UNIX, this option can be used to powerful effect in conjunction with the find(1) command. For exam‐
ple, to archive all the C source files in the current directory and its subdirectories:
find . -name "*.[ch]" -print | zip source -@
(note that the pattern "*.[ch]" must be quoted to keep the shell from expanding it). zip will also accept
a single dash ("-") as the zip file name, in which case it will write the zip file to standard output,
allowing the output to be piped to another program. For example:
zip -r - . | dd of=/dev/nrst0 obs=16k
would write the zip output directly to a tape with the specified block size for the purpose of backing up
the current directory.
zip also accepts a single dash ("-") as the name of a file to be compressed, in which case it will read
the file from standard input, allowing zip to take input from another program. For example:
tar cf - . | zip backup -
would compress the output of the tar command for the purpose of backing up the current directory. This
generally produces better compression than the previous example using the -r option, because zip can take
advantage of redundancy between files. The backup can be restored using the command
unzip -p backup | tar xf -