I want to search a folder of PDFs to find a particular string and get back a list of matches with a little of the surrounding context.
mdfind -onlyin ~/Dropbox/PDFs 'term' >> ~/Dropbox/searches/term.txt
I can get a list of files that contain a match, but I would like to see a little of the surrounding context so that I can tell a little bit more about the match. Ideally, with the filename prepended.
~/Dropbox/PDFs/file1.pdf: here is the term you were searching
~/Dropbox/PDFs/file1.pdf: with term limits
~/Dropbox/PDFs/file2.pdf: the German term for a
~/Dropbox/PDFs/file3.pdf: come up with a term for