我需要制作一个 zip 文件,从包含 ~500k 文件的目录中归档 ~100k 文件。当我尝试明显的命令时,我收到“参数列表太长”错误:
zip archive.zip *pattern*.txt # fails
zip archive.zip `find . -name "*pattern*.txt"` # fails
Run Code Online (Sandbox Code Playgroud)
一种方法是使用-@选项通过标准输入提供文件列表:
find . -name "*pattern*.txt" | zip -@ archive.zip
Run Code Online (Sandbox Code Playgroud)
但是,zip手册页说:
如果文件列表指定为 -@ [Not on MacOS],则 zip 从标准输入而不是从命令行获取输入文件列表。
困扰我的是“不在 MacOS 上”。我继续尝试了这个-@选项,它似乎有效;但我对它是否真的在做正确的工作感到紧张(归档所有文件,完整无缺)。
以下是我的问题:
-@在 MacOS 上不行?-@什么?请注意,此处给出的解决方案zip: Argument list too long (80.000 files in total)将不起作用;我需要归档目录中的一些文件,而不是全部。
我正在运行 Mac OS 10.7.5。这是一些版本信息:
$ bash --version
GNU bash, version 3.2.48(1)-release …Run Code Online (Sandbox Code Playgroud) 我特林建设boost,在指导我读过
When you extract the library from its zip file, you must preserve its internal directory structure (for example by using the -d option when extracting). If you didn't do that when extracting, then you'd better stop reading this, delete the files you just extracted, and try again!
问题是:如何解压缩zip文件并“保留内部目录结构”?我应该使用什么程序以及如何使用?我安装了 7zip 和 Total Commander,这些程序之一可以“保留内部目录结构”吗?
Windows 上的 7-Zip 将在压缩 .zip 文件时保存创建日期和访问日期,但它不会为其(指 7-Zip)原生 .7z 格式执行此操作。任何基于 Unix 的格式都不符合条件。是否有其他格式支持这两个字段?
我有一个在 Windown/MS Word 中打开的 ZIP 文件(实际上它是一个 .DOCX 文件)。使用 LibreOffice / Mac 打开它会产生:
General Error.
General input/output error.
Run Code Online (Sandbox Code Playgroud)
File说:
../Commission Plan.docx: Zip archive data, at least v2.0 to extract
Run Code Online (Sandbox Code Playgroud)
并unzip说:
Archive: ../Commission Plan.docx
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory …Run Code Online (Sandbox Code Playgroud) 我偶然发现lrzip作为一种压缩工具,与 gzip 相比,压缩是疯狂的。
lrzip 将 300MB 的文本文件压缩到 7MB,而 gzip 只能将其压缩到 100MB。
我已将文件从 ubuntu 机器传输到 Windows,但现在不确定如何在 Windows 上解压缩 lrzip 文件?
如何找到一个文件夹的所有子文件夹并分别压缩它们?
文件夹结构
./folder
-subfolder_1
-subfolder_2
-subfolder_3
Run Code Online (Sandbox Code Playgroud)
预期结果:
./folder
-subfolder_1.zip
-subfolder_2.zip
-subfolder_3.zip
Run Code Online (Sandbox Code Playgroud)
我已经尝试过以下方法:
for i in .; do zip -r $i.zip $i; done;
Run Code Online (Sandbox Code Playgroud)
生成一个包含所有子文件夹的..zip文件
我有一个包含很多 .7z 文件的目录,我需要将每个文件重新打包为 zip 存档,如何在 linux 上自动执行此操作?
我在 Mac 上创建了一个包含三个部分的大 zip 文件:
东西.z01 东西.z02 东西.z03
我为此使用了终端 zip 命令。
如何在我的 Windows 机器上解压缩这些文件?
当我尝试破解 zip 文件时,它总是显示 -bash: zip2john: 命令未找到。我通过自制程序安装,运行 john 显示没有错误,我不确定是命令未安装还是什么?当我运行 ls /bin/ 时,我没有看到 zip2john 命令。我尝试了列出的解决方案命令 zip2john 不起作用,但仍然不起作用。对于这些员工来说是新的。帮助 T_T(设备:Mac Big Sur)
如果我听起来很有线,我很抱歉!
在阅读了wiki中的.zip和后,我意识到主要区别之一是大小限制。.zip64
这是我的选择:
| SL# | 原始文件 | 文件大小 | 压缩扩展 | 解压所需的 zip 存档 |
|---|---|---|---|---|
| 1 | abc.doc | 3.5GB | 。压缩 | v 2.0 |
| 2 | def.doc | 4.5GB | 。压缩 | v 4.5 |
仅供参考,对于这两个文件,文件扩展名都是.zip,尽管 #2 使用的是zip64。
.zip64我的问题是,既然它是 zip64 文件,它 (# 2) 不应该有扩展名吗?
或者是我缺乏对 zip64 压缩文件也有.zip扩展名的理解?
zip ×10
7-zip ×4
linux ×3
archiving ×2
bash ×2
compression ×2
macos ×2
windows ×2
command-line ×1
date ×1
docx ×1
libreoffice ×1
mac ×1
recursive ×1