The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 07-14-2008
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,926

Code:
find /home/username -name '*.xml' -exec grep '<start>' {} +

If your find does not support the + syntax, try this:


Code:
find /home/username -name '*.xml'|xargs grep '<start>'

It should be more efficient than:


Code:
find /home/username -name '*.xml' -exec grep  '<start>' {} \; -print

But you should modify it if the filenames contain spaces or other pathological characters.