Exclude unwanted string from Linux grep

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

  1. Gabriel9999

    Gabriel9999 MDL Novice

    Mar 11, 2019
    17
    5
    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 Junior Member

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