Quotidien Shaarli

Tous les liens d'un jour sur une page.

08/23/23

linux - Find a file in lots of zip files (like find command for directories) - Unix & Linux Stack Exchange
thumbnail

Pense-bête

SEARCHED=<file>
for f in $(find . -type f -name "*jar"); do echo "Searching in $f: "; jar tvf $f | grep $SEARCHED; done

Autre solution (moins bien)

#!/bin/bash

find . -type f -name "*jar" -exec sh -c '
export FILE
for FILE
do 
  jar tf $FILE | grep -H --label=$FILE $1
done' sh {} +