Exclude unwanted string from Linux grep

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

  1. Gabriel9999

    Gabriel9999 MDL Novice

    Joined:
    Mar 11, 2019
    Messages:
    37
    Likes Received:
    5
    Trophy Points:
    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

    Joined:
    Feb 20, 2011
    Messages:
    52
    Likes Received:
    21
    Trophy Points:
    0
    grep "to find" myfile.conf | grep -v "to exclude"
     
  3. samueltarcin9999

    samueltarcin9999 MDL Novice

    Joined:
    Mar 11, 2019
    Messages:
    37
    Likes Received:
    10
    Trophy Points:
    0