search a string in a file as ignoring the lines beginning with #

Posted by ephieste on Stack Overflow See other posts from Stack Overflow or by ephieste
Published on 2010-06-08T06:55:57Z Indexed on 2010/06/08 7:02 UTC
Read the original article Hit count: 224

Filed under:
|
|
|
|

I want to find a string such as "qwertty=" in a file with "awk" or "grep" but I don't want to see the lines with #. Please see the example

grep -ni "qwertty"   /aaa/bbb
798:#  * qwertty - enable/disable 
1222:#qwertty=1
1223:qwertty=2  
1224:#qwertty=3

I want to find the line 1223. What should be the search query for this purpose?

© Stack Overflow or respective owner

Related posts about unix

Related posts about find