Skip to content

How To: Use grep

cpx April 19, 2014 1 min read GNU/Linux

OR

$ grep "1\|2" 1.txt 1 2
$ grep -E "1|2" 1.txt 1 2
grep -E "^1$|2" 1.txt 1 2
grep -e 1 -e 2 1.txt 1 2
 egrep "1|2" 1.txt 1 2

AND

grep -E '1.*2' 2.txt 1 2
grep '1' 2.txt | grep '2' 2.txt 1 2 2

NOT

grep -v 1 2.txt
0 0 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x