Exclude unwanted string from Linux grep


Gabriel9999
#1
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!
 
samueltarcin999
+1
#2  Top Rated Post
There are different ways to exclude and grep given a text file or input stream. I generally prefer the most basic one where use two grep where the first one is for exclude with -v option and pipe to second one where I grep for my string. grep -v 'able' config.txt | grep 'system' For more information look https://www.poftut.com/introduction-...with-examples/
 

Similar Threads

0
Grep
by jimmoyer | Feb 28th, 2008