Tuesday, May 7, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 3161  / 2 Years ago, sat, april 2, 2022, 1:14:40

Want to search a file inside a set of jar files. How this can be done in ubuntu termianl?


More From » command-line

 Answers
4

I understand that you want to look for a specific file -- and not search for a string within a file in the .jar archive.



Another option, without zipgrep, just with zip, sed and friends. Suppose you want to look through jar files in the current directory:



for i in *.jar ; do unzip -l "$i" | sed "s?.*?$i: &?" ; done | grep "filetofind"

[#30454] Sunday, April 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oargrou

Total Points: 336
Total Questions: 105
Total Answers: 113

Location: Vietnam
Member since Sun, Oct 18, 2020
4 Years ago
;