I have a requirement to search for an exact word and print a line. It is working if I don't have any .
(dots) in the line.
$cat file
test1 ALL=ALL
w.test1 ALL=ALL
$grep -w test1 file
test1 ALL=ALL
w.test1 ALL=ALL
It is giving the second line also and I want only the lines with the exact word test1
.