Click to See Complete Forum and Search --> : grep: find '200' but not '2001'


hop-frog
07-26-2003, 04:01 PM
I'm looking for the word '200' amongst hundreds of source files.

I have been using:

grep "200" *
grep "200" */*
grep "200" */*/*
grep "200" */*/*/*
grep "200" */*/*/*/*

I keep ending results that I don't want. This includes every single copyright notice listing '2000,' '2001,' '2002,' and '2003.'

Searching for ' 200' or '200 ' (with a space in front or in back) will not help because the number could have any number of other things around it.

Any ideas?

sharth
07-26-2003, 04:17 PM
grep "200[^1]" *
grep "200[^0-9]" *

hop-frog
07-26-2003, 04:29 PM
Thanks!