Friends, On my Mac, I have 100s of zip files in a directory named Test. Let's assume I have files a.zip,b.zip,c.zip....... Now I want to grep all files for a text "searchText" and move the matching files to another folder. I am trying this:
$for file in *; do if zgrep -q 'searchText’ “$file”; then mv “$file” /Users/xyz/Desktop/finalcrashes; fi; done
But this seems not to be working for me. It's working on Ubuntu though. Any help would be appreciated.
Thanks in Advance.