Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!mahendo!wlbr!voder!pyramid!ctnews!risky!sundrag From: sundrag@risky.Convergent.COM (Sundaraswaran Gopalakrishnan) Newsgroups: comp.unix.questions Subject: Re: grep Summary: Use find and xargs for recursive grep Keywords: grep, recursive Message-ID: <4037@risky.Convergent.COM> Date: 15 Apr 91 19:18:24 GMT References: <1991Apr14.214414.9815@hellgate.utah.edu> Organization: Convergent Technologies, San Jose, CA Lines: 42 In article <1991Apr14.214414.9815@hellgate.utah.edu>, mmoore%hellgate.utah.edu@cs.utah.edu (Michael Moore) writes: > > > Does anyone know if there is an easy way to recursively search for a > pattern down the entire file tree of a directory? > I have tried : grep -R pattern * > grep -r pattern * > grep -R pattern dirname > grep -r pattern dirname > > > I don't know what to do. If there were a way to recursively cat > files or something similar, I could pipe that to grep, but I can't find that > either. > > ANY help would be greatly appreciated. > > (P.S. Is this the proper newsgroup to post this question to?) > ( If not, please let me know which one is. ) > > > > Michael Moore > University of Utah > > <><><><><><><>><><><><><><><><><><><><><><> > <>He spoke seldom, ate little, slept less<> > <> -Ursula K. LeGuin <> > <> *Wizard of Earthsea* <> > <><><><<><><><><><><><><><><><><><><><><><> You can do the following : find / -print | xargs grep or, find / -name "*.c" -print | xargs grep xargs constructs the argument list from its input and 'll apply grep to each argument ( which is different from just "find / -print | grep ", which 'll look for a *file* that matches ) Sundar, Unisys