How to grep or awk or sed exact match in linux

I’ve already read this and it didn’t satisfy my test case.

Say I’ve

servername-server

servername

servername_new_bak

Say servername and servername_new_bak aren’t running.

When I do ps -aux| grep servername | wc -l I want only 1 as output as servername is not running, but currently I’m getting 3 as output because servername-server is running.

That’s my use case.

How do I achieve this?

See the following page:
https://www.cyberciti.biz/tips/grepping-ps-output-without-getting-grep.html

1way
cat input.txt |awk ‘{print $1,$2,$3,$4,$(NF-3),$(NF-2),$(NF-1),$NF}’

grep “^string$”
it will search for exact word/string
^ - start with
$ - end with