如何使用unix替换耳中的文件 [英] how to replace file in ear using unix

查看:148
本文介绍了如何使用unix替换耳中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a sample.ear file and I want to replace a particular file inside sample.ear.

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

这里我想要的使用unix将file1.sh替换为更新的文件file1.sh。

here I want to replace file1.sh with updated file file1.sh using unix.

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

I am using jar command but i am not able to replace the file in subdirectories

谢谢

推荐答案

使用:

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

提取 file.sh 。完成修改 com1 / test1 / file1.sh 文件后,使用:

to extract file.sh. Once you are done modifying this com1/test1/file1.sh file use:

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

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

to update the archived ear with the modified file.

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

这篇关于如何使用unix替换耳中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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