linux - Find string in tar.gz and extract result -


is there way find files in tar.gz archive containing specific 'string', , extract these files specified folder?

zgrep -a 'stringtofind' inarchive.tar.gz gives me result in files string can found, cannot without extracting entire archive.

is there way around this?

edit: dont need use zgrep, option out there suffice me, relatively fast operations

(assuming gnu tar, think) try like

zgrep -a 'stringtofind' inarchive.tar.gz > your.list

then

tar zxf inarchive.tar.gz --files-from=your.list


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -