上下文:有关如何为带有依赖项的python代码创建zip文件的AWS文档,请参阅:https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
我知道-r是递归标志,但我不清楚-r9中的"9“实现了什么?
~/my-function$ cd package
~/my-function/package$ zip -r9 ${OLDPWD}/function.zip .
adding: PIL/ (stored 0%)
adding: PIL/.libs/ (stored 0%)
adding: PIL/.libs/libfreetype-7ce95de6.so.6.16.1 (deflated 65%)
adding: PIL/.libs/libjpeg-3fe7dfc0.so.9.3.0 (deflated 72%)
adding: PIL/.libs/liblcms2-a6801db4.so.2.0.8 (deflated 67%)
...发布于 2019-09-17 15:19:10
-r9是-r和-9交换机的组合。
交换机-9表示最强压缩,范围从0到9。
键入zip以显示选项列表。
发布于 2020-07-31 07:27:50
为了补充@Zerte的答案,下面是zip --help的输出
-f freshen: only changed files -u update: only changed or new files
-d delete entries in zipfile -m move into zipfile (delete OS files)
-r recurse into directories -j junk (don't record) directory names
-0 store only -l convert LF to CR LF (-ll CR LF to LF)
-1 compress faster -9 compress better
-q quiet operation -v verbose operation/print version info
-c add one-line comments -z add zipfile comment
-@ read names from stdin -o make zipfile as old as latest entry
-x exclude the following names -i include only the following names
-F fix zipfile (-FF try harder) -D do not add directory entries
-A adjust self-extracting exe -J junk zipfile prefix (unzipsfx)
-T test zipfile integrity -X eXclude eXtra file attributes
-y store symbolic links as the link instead of the referenced file
-e encrypt -n don't compress these suffixes
-h2 show more help如上所述,-r标志产生recurse into directories
https://stackoverflow.com/questions/57965208
复制相似问题