zip -h 令人困惑!我只想知道如何从目录制作 .zip。 kthxbi
最佳答案
zip -r archive.zip dir_to_zip
来自 man zip
-r
--recurse-paths
Travel the directory structure recursively; for example:
zip -r foo.zip foo
or more concisely
zip -r foo foo
In this case, all the files and directories in foo are saved in a zip archive
named foo.zip,including files with names starting with ".", since the recursion
does not use the shell's file-name substitution mechanism...
即使它运行良好,我也想向您推荐 7z( http://www.7-zip.org/ )。
7za a directory.7z directory
它有更好的压缩,并且是开源,GNU LGPL 许可证,可免费用于 windows、linux、BSD...
顺便说一句,它创建/打开 7z、XZ、BZIP2、GZIP、TAR、ZIP 和 WIM,
仅打开解包:ARJ、CAB、CHM、CPIO、CramFS、DEB、DMG、FAT、HFS、ISO、LZH、LZMA、MBR、MSI、NSIS、NTFS、RAR、RPM、SquashFS、UDF、VHD、WIM、XAR和 Z。
[他们应该付钱给我做广告:-)]
关于linux - 我如何在 linux 上制作一个 zip 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24418651/