RGREP(1)

NAME
rgrep - recursive grep

SYNOPSIS
rgrep [flags] pattern path ...

DESCRIPTION
rgrep recursively searches files in the named paths (or searches stdin if no arguments are given) for lines containing the given pattern.

Like the more-traditional grep, it has many options that change how it works, but many of these options are subtly different:

-c  Count matches; don't print the lines that contain the patterns, just the matches.

-e  Use POSIX-style regular expressions.

-h  When displaying lines that matches, highlight the text that matches the pattern.

-H  Don't display lines that match the pattern, display the text that matches the pattern.

-i  Ignore case.

-l  Print the name of each file that contains a the pattern.

-n  As well as the line, print the line number of each line that matches the pattern.

-F  Follow links.

-r  Recursively scan through directories (this is the default.)

-N  Don't recurse. This makes rgrep into a somewhat clumsy superslow grep.

-R pat
    Search only filenames that match pat.

-v  Print (count) only lines that do NOT contain the pattern.

-x pat
    Search only filenames that have the extension pat.

-D  Instead of searching, just print the names of the directories that would be searched. (This makes rgrep into a somewhat slower version of find(1))

-W len
    Input files contain fixed-length records len characters long.
The regular expression format that rgrep uses is a slightly extended version of the "basic" regular expressions used in Henry Spencer's regex library. Regular expressions are made up of plain text, plus the following special characters:

.   Match any single character except newlines.

\d  Match any digit.

\e  Match the ESCAPE character.

*   Match zero or more of the previous RE.

+   Match one or more of the previous RE.

?   Match zero or one of the previous RE.

^   Match beginning of line.

$   Match end of line.

[...]
    Matches any single character between the brackets. As special cases, a leading ^ means match everything EXCEPT the characters between the branches, and a - between two characters means to match any character between those two (so [a-z] would mean to match any lowercase character, and [0-9] would match any single digit.

\<  Match the beginning of a word.

\>  Match the end of a word.

\{ num \}
    Match num instances of the previous RE.

\( RE \)
    Match RE as a subexpression.

\<digit>
    Match what was matched by the <digit>'th \ Ns ( RE \ Ns ) subexpression.

BUGS
1. The \d metacharacter is not implemented.
2. The \{ ... \} command is not fully implemented.

AUTHOR
David Parsons (<orc@pell.chi.il.us>)
The regular expression code is Henry Spencer's regex code (modified to support \<, \>, \e, file ...?, and +.)

COPYRIGHT
rgrep is Copyright 2007 by David Parsons.
The regex library is Copyright 1992, 1993, 1994, 1997 Henry Spencer.

SEE ALSO
grep(1), re_format(7)

HISTORY
A version of the rgrep command is distributed with John Davis's jed(8) editor.