western willow ventures inc.

eye on the net
  • Home
  • Contact
  • Web
  • Graphics
  • ARDi
  • Samples
  • Terms of Service
  • Fun
  • Privacy

Search

Home

grep

Recursive search for files with specific content using GREP

Fri, 2011-02-18 14:03 |  Franco

So you know that somewhere in your source folder (/source) that there is a script that uses the foo() function but you cant remember which one and there are thousands of files, what do you do?

You grep them!

grep -R -i -n 'foo()' *

Lets break it down, first we are grepping files, the -R indicates to search recursively, -i indicates we want to ignore case, and -n indicates we want to know which line of the file grep finds our search string on. then the search string in single quotes and lastly, a finame wildcard, in this case, search through every file.

Franco's blog |  Login to post comments |  1317 reads |  Tags: command line, grep, linux, ubuntu

Popular content

Today's:

  • Contact
  • Raven Lovers
  • Agriculture and Conservation

All time:

  • Contact
  • Web
  • ARDi - Aerial Research Drone One

Last viewed:

  • fox.jpg
  • Count the lines of code in a drupal project on linux
  • Flight Training and simulation

Navigation

  • Login
  • Album photos
  • Contact form
  • Feed aggregator
© 2010 Western Willow Ventures Inc.

Designed by Heidi Selzler.