Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 11-15-2003
kduffin's Avatar
kduffin kduffin is offline Forum Advisor  
UN1X
 

Join Date: Nov 2003
Location: Maryland
Posts: 449
Hey Rob,

Using find is probably your best bet. If you are wanting to parse all files in a directory called somedir, you can:

$ find /path/to/somedir -type f -exec grep blue {} \;

Find is an extremely useful command, you can specify multiple files, access time, modification time etc. etc. The man page is worth a read. The -exec executes the next command and places the argument (in this case the file it found) to the right of the {}. Using exec rather than xargs keeps you to fewer sys calls.

Hope this helps.

Cheers,
Keith

Last edited by kduffin; 11-17-2003 at 10:29 PM..