压缩文件并打印到标准输出 [英] Zip file and print to stdout

查看:526
本文介绍了压缩文件并打印到标准输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要带有zip的存档文件,并实时将zip数据打印到stdout. 标准zip程序只能创建zip文件. 可以使用-c属性执行gzip,但使用gzip算法.

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.

推荐答案

使用-时,Info-ZIP中的zip程序(通常在Linux系统上找到)允许将ZIP文件生成为标准输出.作为文件名.例如,您可以使用以下命令将zip文件发送到远程主机上的端口8787:

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

所有这些都记录在 zip命令手册页中.

这篇关于压缩文件并打印到标准输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆