1:
Code:
for file in *.zip ; do if unzip -qq -l $file | awk '{ print $4 }' | grep filename_to_look_for > /dev/null ; then echo $file ; fi ; done
2:
Code:
for file in *.zip ; do if unzip -p $file | strings | grep searchstring > /dev/null ; then echo $file ; fi ; done
If you want to get the file within the zip, it'll be a slower search but you can do this:
Code:
#!/bin/su
$searchstring=$1
for zipfile in *.zip
do
unzip -qq -l $zipfile | awk '{ print $4 }' | while read file
do
if unzip -p $zipfile $file | grep $searchstring > /dev/null
then
echo "$zipfile / $file"
fi
done
done