table of contents
| RGREP(1) | User Manuals | RGREP(1) |
NAME¶
rgrep - a recursive, highlighting grep program
SYNOPSIS¶
rgrep [ options ] pattern [ file ] ...
DESCRIPTION¶
rgrep, unlike grep(1) and egrep(1) rgrep has the ability to recursively descend directories. The traditional way of performing this kind of search on Unix systems utilizes the find(1) command in conjunction with grep(1). However, this results in very poor performance.
COMMAND LINE OPTIONS¶
-?
SUPPORTED REGULAR EXPRESSIONS:¶
.
\{ ... \}
\( ... \)
\1, \2, ..., \9
EXAMPLES¶
Look in all files with a 'c' extension in current directory and all its subdirectories looking for matches of 'int ' at the beginning of a line, printing the line containing the match with its line number: (two methods)
rgrep -n -R '*.c' '^int ' .
rgrep -n -x c '^int ' .
Highlight all matches of repeated words in file 'paper.tex':
rgrep -h '[ \t]\([a-zA-Z]+\)[\\t]+\1[\t ' paper.tex
rgrep -h '^\([a-zA-Z]+\)[\\t]+\1[+\t ' paper.tex
(Note that this version of rgrep requires two passes for this example)
Search through all files EXCEPT .o and .a file below /usr/src/linux looking for the string 'mouse' without regard to case:
rgrep -i -R '*.[^ao]' mouse /usr/src/linux
Search a fixed record length FITS file for the keyword EXTNAME:
rgrep -W80 ^EXTNAME file.fits
(Note that the regular expression '^[A-Z]+' will dump all fits headers.)
AUTHOR¶
-- This manpage was translated to troff by
"Boris D. Beletsky" <borik@isracom.co.il>
| OCT 1996 | Debian |