home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / question / 15063 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!nwnexus!Celestial.COM!bill
  3. From: bill@Celestial.COM (Bill Campbell)
  4. Subject: Re: recursive grep'ing
  5. Organization: Celestial Software, Mercer Island, WA
  6. Date: Wed, 30 Dec 1992 18:21:41 GMT
  7. Message-ID: <1992Dec30.182141.6976@Celestial.COM>
  8. References: <Bzvwwo.Aq8@NCoast.ORG> <1992Dec28.043508.3237@csie.nctu.edu.tw> <BAB.92Dec28110925@se39.wg2.waii.com>
  9. Lines: 24
  10.  
  11. In <BAB.92Dec28110925@se39.wg2.waii.com> bab@se39.wg2.waii.com (Brian Button) writes:
  12.  
  13. ........
  14. >Ji-Tzay> find . -name "*" -print | xargs grep "YOUR PATTERN"
  15.  
  16. >You should be able to drop the -name part, since you want all names.
  17.  
  18. >Just use find . -print | xargs grep "PATTERN"
  19.  
  20. This would merrily grep your directories too which probably isn't
  21. what you want.
  22.  
  23.     find . -type f -print | xargs grep 'pattern' /dev/null
  24.  
  25. Only looks at the files and the /dev/null argument insures that
  26. grep will always have at least two files as arguments so that it
  27. will display the filename.
  28.  
  29. Bill
  30. -- 
  31. INTERNET:  bill@Celestial.COM   Bill Campbell; Celestial Software
  32. UUCP:   ...!thebes!camco!bill   6641 East Mercer Way
  33.              uunet!camco!bill   Mercer Island, WA 98040; (206) 947-5591
  34. SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?
  35.