.TH pdfgrep 1 "February 14, 2012" "version 1.2" "USER COMMANDS" .SH NAME pdfgrep \- search pdf files for a regular expression .SH SYNOPSIS .B pdfgrep .RI [ OPTION .\|.\|.] .I PATTERN .IR FILE .\|.\|. .SH DESCRIPTION Search for \fIPATTERN\fP in each \fIFILE\fP. \fIPATTERN\fP is an extended regular expression. .PP .B pdfgrep works much like grep, with one distinction: It operates on pages and not on lines. .SH OPTIONS .TP .BR \-i ", " \-\^\-ignore-case Ignore case distinctions in both the \fIPATTERN\fP and the input files. .TP .BR \-H ", " \-\^\-with-filename Print the file name for each match. This is the default setting when there is more than one file to search. .TP .BR \-h ", " \-\^\-no-filename Suppress the prefixing of file name on output. This is the default setting when there is only one file to search. .TP .BR \-n ", " \-\^\-page-number Prefix each match with the number of the page where it was found. .TP .BR \-c ", " \-\^\-count Suppress normal output. Instead print the number of matches for each input file. Note that unlike grep, multiple matches on the same page will be counted individually. .TP .BR \-C ", " \-\^\-context " " \fINUM\fP Print at most \fINUM\fP characters of context around each match. The exact number will vary, because pdfgrep tries to respect word boundaries. If \fINUM\fP is "\fBline\fP", the whole line will be printed. If this option is not set, pdfgrep tries to print lines that are not longer than the terminal width. .TP .BR \-\^\-color " " \fIWHEN\fP Surround file names, page numbers and matched text with escape sequences to display them in color on the terminal. (The default setting is \fBauto\fP). .RS .PP .I WHEN can be: .TP .B always Always use colors, even when stdout is not a terminal. .TP .B never Do not use colors. .TP .B auto Use colors only when stdout is a terminal. .RE .TP .BR \-R ", " \-r ", " \-\^\-recursive Recursively search all files (restricted by \fB\-\^\-include\fP and \fB\-\^\-exclude\fP) under each directory. .TP .BR \-\^\-exclude=\fIGLOB\fP Skip files whose base name matches \fIGLOB\fP. See \fBglob\fP(7) for wildcards you can use. You can use this option multiple times to exclude more patterns. It takes precedence over \fB\-\^\-include\fP. Note, that in- and excludes apply only to files found via \fB\-\^\-recursive\fP and not to the argument list. .TP .BR \-\^\-include=\fIGLOB\fP Only search files whose base name matches \fIGLOB\fP. See \fB\-\^\-exclude\fP for details. The default is \fI*.pdf\fP. .TP .BR \-\^\-unac Remove accents and ligatures from both the search pattern and the PDF documents. This is useful if you want to search for a word containing 'ae', but the PDF uses the single character 'æ' instead. See \fBunac(3)\fP and \fBunaccent(1)\fP for details. \fB[This option is experimental and only available if pdfgrep is compiled with unac support.]\fP .TP .BR \-q ", " \-\^\-quiet Suppress all normal output to stdout. Errors will be printed and the exit codes will be returned (see below). .TP .BR \-\^\-help Print a short summary of the options. .TP .BR \-V ", " \-\^\-version Show version information . .SH "ENVIRONMENT VARIABLES" The behavior of .B pdfgrep is affected by the following environment variable. .TP .B GREP_COLORS Specifies the colors and other attributes used to highlight various parts of the output. The syntax and values are like .B GREP_COLORS of \fBgrep\fP. See \fBgrep\fP(1) for more details. Currently only the capabilities \fBmt\fP, \fBms\fP, \fBmc\fP, \fBfn\fP, \fBln\fP and \fBse\fP are used by \fBpdfgrep\fP, where \fBmt\fP, \fBms\fP and \fBmc\fP have the same effect on \fBpdfgrep\fP. . .SH 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 \fB--quiet\fP or \fB-q\fP option is used and a match was found, \fBpdfgrep\fP will return 0 regardless of errors. .SH AUTHOR Hans-Peter Deifel .SH SEE ALSO grep(1), regex(7)