With the find you can easily iterate over all directories and map them to a named template, such as *.zip .
When you go to the list returned by find (the for loop will be good here), you will need to specify the files in each archive (you will not need to extract the files, which is good) and while you list the files, you can do a simple grep to find the template .json and the channel that displays on wc -l , which will give you a "line count" - in this case it will represent the number of .json .
During each iteration, you must take this account and add it to the "total" account, which you can then withdraw later.
An extended example of this:
total=0; for file in `find . -name '*.zip'`; do count=`unzip -l $file | grep '.json' | wc -l`; total=`expr $total + $count`; done; echo "Total Json Files: $total";
This example assumes that you are using zip to archive your files. If you use something like tar , you will need to use its file list options ( tar -t ).
source share