Skip to main content

Finding info in Files

Sometimes you want to be able to quickly search the contents of some files for a command or some other piece of text. The following command (for Cygwin obviously) will work:

for i in `find /cygdrive/c/Devel/SQL/ | grep sql`; do echo $i; grep cursor $i; done;

For regular linux, the command would be:

for i in `find ~/devel/sql/ | grep sql `; do echo $i; grep 'cursor' $i; done;

Both of these commands search for the word cursor in the SQL files.