I have these:
$ cat a.tmp
ABB.log
ABB.log.122
ABB.log.123
I want to find a exact match of ABB.log
.
But when I do:
$ grep -w ABB.log a.tmp
ABB.log
ABB.log.122
ABB.log.123
it shows all of the lines.
Can I get what I want using grep?
Simply specify the regexp anchors.
grep '^ABB\.log$' a.tmp