Exclude unwanted string from Linux grep

Gabriel9999

Member
Joined
Mar 12, 2019
Messages
38
Reaction score
4
Credits
130
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!
 


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
6,870
Reaction score
5,660
Credits
21,544
Moving this to Command Line Gabriel

Good luck

Wizard
 

kenJackson

Member
Joined
Mar 11, 2019
Messages
55
Reaction score
46
Credits
0
Use grep -v
Code:
$ echo -e 'abcd\nefgh'
abcd
efgh
$ echo -e 'abcd\nefgh' | grep -v bc
efgh
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Latest posts

Top