如何在Linux中递归搜索war,ear和jar文件中的文件

ash*_*k_p 10 linux file-search jar

我需要在包含 war、ear 和 jar 存档文件的文件夹中搜索文件 (logo.png)。任何人都可以帮助我执行命令吗?

ken*_*orb 10

jar文件中搜索:

find . -name \*.jar -exec sh -c 'printf "\n\nFile: {}"; jar tf {}' ";" | less +/foo
Run Code Online (Sandbox Code Playgroud)

战争文件类似:

find . -name \*.war -exec sh -c 'printf "\n\nFile: {}"; unzip -l {}' ";" | less +/foo
Run Code Online (Sandbox Code Playgroud)

更改foo为您感兴趣的文本(例如abc.png)。

您可以按:

  • n 搜索下一个模式匹配。
  • Shift+n向后搜索,
  • /+ 键入something+Enter以搜索另一个短语。

查看类似,但在 Windows 上:查找哪些 jars 包含文件