Reputation: 25
I want to search files for \xc2 but exclude \xc2\xbb
I have grep -rnwl '/home/rascalofthenorth/development/html/' -e "xc2"
Upvotes: 0
Views: 54
Reputation: 3140
You can also do it using -v option of grep like this:
grep -rnwl '/home/rascalofthenorth/development/html/' -e "xc2" | grep -v "xbb"
The -v option shows only results not containing xbb
.
Or for more specific cases in which you want, say, xc2 to appear and xbb not to appear, then awk comes in handy:
awk '/xc2/ && !/xbb/' <yourfile>
Upvotes: 1