linux如何将文件添加到zip文件中的特定文件夹 [英] linux how to add a file to a specific folder within a zip file

查看:828
本文介绍了linux如何将文件添加到zip文件中的特定文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何将文件添加到zip文件中的根文件夹中:

i know how to add a file to the root folder within a zip file:

zip -g xxx.apk yyy.txt

zip -g xxx.apk yyy.txt

但我不知道如何在zip文件中指定特定文件夹

but i've no idea how to specify a particular folder within a zip file

推荐答案

如果您需要将文件添加到与原始目录层次结构相同的文件夹中,则只需向其添加完整路径:

If you need to add the file to the same folder as in the original directory hierarchy, then you just need to add the full path to it:

zip -g xxx.zip folder/file

否则,最简单的方法可能是在临时目录的zip文件中创建所需的布局.

Otherwise, probably the easiest way to do that is to create the same layout you need in the zip file in a temporary directory.

这篇关于linux如何将文件添加到zip文件中的特定文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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