Skip to content

Instantly share code, notes, and snippets.

@kkleidal
Created May 18, 2015 18:39
Show Gist options
  • Save kkleidal/7153ff02d4b6a7949994 to your computer and use it in GitHub Desktop.
Save kkleidal/7153ff02d4b6a7949994 to your computer and use it in GitHub Desktop.
Search text of pdfs in working directory
#!/bin/bash
# Based on http://stackoverflow.com/questions/4643438/how-to-search-contents-of-multiple-pdf-files
find $(pwd) -name '*.pdf' -exec sh -c "pdftotext '{}' - | grep --with-filename --label='{}' --color '$1'" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment