4.11. Recursive grep (rgrep, grep -R)

 <  Day Day Up  >  

4.11. Recursive grep ( rgrep , grep “R )

Unlike the members of the grep family, Linux's rgrep can recursively descend a directory tree. Rgrep has a number of command-line options and supports the same metacharacters as regular grep ( grep “R ). See Appendix A for a complete description of rgrep , or type rgrep “? for online help (not supported on regular versions of UNIX).

Example 4.52.
 %  grep -r 'Tom' ./dir  %  rgrep 'Tom' ./dir  

EXPLANATION

Searches recursively for all files containing Tom starting from under the ./dir directory.

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net