Match exact string using grep
Try one of:
grep -w "deiauk" textfile
grep "\<deiauk\>" textfile
Try this with GNU grep
and mark word boundaries with \b
:
grep "\bdeiauk\b" file
Output:
deiauk 1611516 afsdf 765
See: http://www.regular-expressions.info/wordboundaries.html
If your grep
supports -P
(PCRE), you can do:
$ grep -P '(^|\s)\Kdeiauk(?=\s|$)' file.txt
deiauk 1611516 afsdf 765
deiauk 1611516 afsdf ddfgfgd