grep tips

grep tips

The following will create a new file with lines removed containing given pattern:

cat file.txt | grep -v "pattern" >filtered.txt

Match two words:
grep -E -i -w 'word1|word2' sourcefile.txt

Leave a Reply