gpt4 book ai didi

unix - 如何使用unix替换ear中的文件

转载 作者:行者123 更新时间:2023-12-04 18:43:09 26 4
gpt4 key购买 nike

我有一个 sample.ear 文件,我想替换 sample.ear 中的特定文件。

consider ear file sample.ear which content com1/test1/file1.sh and com2/file2.sh  

在这里,我想使用 unix 用更新的文件 file1.sh 替换 file1.sh。

我正在使用 jar 命令,但我无法替换子目录中的文件

谢谢

最佳答案

用:

jar -xf sample.ear com1/test1/file1.sh 

提取 file.sh .完成修改后 com1/test1/file1.sh文件使用:
jar -uf sample.ear com1/test1/file1.sh

使用修改后的文件更新存档的耳朵。

使用 jar --help获取详细帮助。

关于unix - 如何使用unix替换ear中的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20093258/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com