table of contents
PDFGREP(1) | Pdfgrep Manual | PDFGREP(1) |
NAME¶
pdfgrep - search pdf files for a regular expressionSYNOPSIS¶
pdfgrep [OPTION...] PATTERN [FILE...]DESCRIPTION¶
Search for PATTERN in each FILE. PATTERN is an extended regular expression.pdfgrep works much like grep, with one distinction: It operates on pages and not on lines.
OPTIONS¶
-i, --ignore-case-F, --fixed-strings
--cache
-P, --perl-regexp
-H, --with-filename
-h, --no-filename
-n, --page-number
-c, --count
-p, --page-count
--color WHEN
always
never
auto
-o, --only-matching
-r, --recursive
-R, --dereference-recursive
-A NUM, --after-context=NUM
-B NUM, --before-context=NUM
-C NUM, --context=NUM
--exclude=GLOB
--include=GLOB
--password=PASSWORD
-m, --max-count NUM
-Z, --null
--match-prefix-separator SEP
--debug
--warn-empty
--unac
This option is experimental and only available if pdfgrep is compiled with unac support.
-q, --quiet
Errors will be printed and the exit codes will be returned (see below).
--help
-V, --version Show version information.
EXIT STATUS¶
Normally, the exit status is 0 if at least one match is found, 1 if no match is found and 2 if an error occurred. But if the --quiet or -q option is used and a match was found, pdfgrep will return 0 regardless of errors.ENVIRONMENT VARIABLES¶
The behavior of pdfgrep is affected by the following environment variable.GREP_COLORS
FILES¶
${XDG_CACHE_HOME}/pdfgrep/*EXAMPLES¶
Print the first ten lines matching pattern and print their page numberpdfgrep -n --max-count 10 pattern foo.pdf
Search all .pdf files whose names begin with foo recursively in the current directory
pdfgrep -r --include "foo*.pdf" pattern
Search all .pdf files that are smaller than 12M recursively in the current directory
find . -name "*.pdf" -size -12M -print0 | xargs -0 pdfgrep pattern
Note that in contrast to the previous examples, this task could not be solved with pdfgrep alone, but the Unix tools find(1) and xargs(1) had to be used. That’s because pdfgrep itself doesn’t include options to exclude files by their size. But as you see, it doesn’t have to!
BUGS¶
Reporting Bugs¶
Bugs can either be reportet to the mailing list (pdfgrep-users@pdfgrep.org) or to the bugtracker on gitlab (https://gitlab.com/pdfgrep/pdfgrep/issues).AUTHORS¶
pdfgrep is maintained by Hans-Peter Deifel.See the AUTHORS file in the source for a full list of contributors.
SEE ALSO¶
grep(1), pcre(3), regex(7)See pdfgrep’s website https://pdfgrep.org for more information, downloads, git repository and more.
01/25/2017 | Pdfgrep 2.0 |