我正在 Linux 中为 Ansible 创建 shell 命令,我有一个 .war文件,我只需要其中的tasks.properties文件。我尝试了下面的方法,但它提取了父目录文件夹WEB-INF,因此,当我只需要外面的test.properties时,我提取了WEB-INF/sub/test.properties
unzip test.war "*test.properties*"
Run Code Online (Sandbox Code Playgroud)
我也尝试过
jar xf test.war test.properties
Run Code Online (Sandbox Code Playgroud)
这还提取了主文件夹和WEB-INF/sub/test.properties。
当我时ls,我只想test.properties出现在我运行它的位置,关于如何做到这一点有什么建议吗?