简体   繁体   中英

Search a string in compressed files in compressed file

I have a compressed file (an EAR), which contains several compressed files (EAR's, WAR's and JAR's), which also may contain compressed files (JAR's.). Is there a way to find a specific string in this structure using UNIX commands without manually decompressing them one by one?

Thank You.

With the Java jar executable ( jar tf yourEar.ear ), you coud list all contained files in in the EAR in the standard output.
But it doesn't list recursively jars .

So you could :

  • chain this result to a grep that specifies the searched string in the filename.
  • for each filename ended with .jar listed in the output, you could reuse the same logic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM