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

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

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -