Exclude unwanted string from Linux grep

Discussion in 'Linux' started by Gabriel9999, Apr 3, 2019.

  1. Gabriel9999

    Gabriel9999 MDL Novice

    Mar 11, 2019
    9
    0
    0
    I have a configuration file which is a simple text. I want to list some configuration line but except some sitring. How can I use Linux grep to exclude and search for given strings? Thanks in advance for your help!
     
  2. shot²

    shot² MDL Novice

    Feb 20, 2011
    44
    12
    0
    grep "to find" myfile.conf | grep -v "to exclude"