Eug*_*ell 3 bash shell zipfile
我正在寻找一个shell命令(最好是一个单行程序),它将创建一个包含压缩和存储内容的zip文件(通过存储,我的意思是未压缩,如官方文档中所述,链接1).
该.ZIP文件格式规范给出了混合不同的压缩类型,包括刚刚存储的文件的自由:
4.1.8放置在ZIP文件中的每个数据文件都可以进行压缩,存储,加密或数字签名,而不管归档同一个ZIP文件中的其他数据文件的方式.
如果有必要,可通过申请/ zip下的IANA注册中心注册的媒体类型确认此技术可能性:
A.本地文件头:
本地文件头签名4个字节(0x04034b50)..压缩方法2个字节
直到现在我尝试了几个zip参数(-f -u -U
,..)失败了
理想情况下,命令会压缩文本文件,并存储二进制内容,区别在于它们的文件扩展名(例如:html,css,js将被视为文本,jpg,ico,jar将被视为二进制).
你在寻找-n
国旗吗?
-n suffixes --suffixes suffixes Do not attempt to compress files named with the given suffixes. Such files are simply stored (0% compression) in the output zip file, so that zip doesn't waste its time trying to compress them. The suffixes are separated by either colons or semicolons. For example: zip -rn .Z:.zip:.tiff:.gif:.snd foo foo will copy everything from foo into foo.zip, but will store any files that end in .Z, .zip, .tiff, .gif, or .snd without trying to compress them.