Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zip file and print to stdout

Tags:

linux

zip

I need archive file with zip and print zip-data to stdout in realtime. Standard zip program may create zip file only. This can do gzip with -c attribute, but it use gzip algorithm.

like image 983
Cosmologist Avatar asked Sep 21 '13 14:09

Cosmologist


1 Answers

The zip program from Info-ZIP (the one usually found on Linux systems) allows generating ZIP files into the standard output, when you use - as the name of the file. For example you could send a zip file to port 8787 on a remote host with this command:

zip -r - files_to_be_archived | nc remotehost 8787

All of this is documented on the zip command manual page.

like image 76
Joni Avatar answered Oct 06 '22 04:10

Joni