Regular expression – GREP: How to search for, but simultaneously exclude some match

I need a way to simplify this command:

grep'SEARCHTERM' server.log | grep -v ' PHHIABFFH' | grep -v'Stats'

It should find all rows including SEARCHTERM, but exclude if one of the SEARCHTERM rows contains PHHIABFFH or Stats.

This will work:

grep'SEARCHTERM' server.log | grep -Ev'PHHIABFFH|Stats'

I need a way to simplify this command:

grep 'SEARCHTERM' server.log | grep -v'PHHIABFFH' | grep -v'Stats'

It should find all rows including SEARCHTERM, but exclude if one of the SEARCHTERM rows contains PHHIABFFH or Stats .

This will work:

grep'SEARCHTERM' server.log | grep- Ev'PHHIABFFH|Stats'

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5415 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.