You need a more specific expression. Try grep " OK$" or grep "[0-9]* OK" . You want to select a template that matches what you want, but doesn't match what you donβt want. This template will depend on how your content will look like all the content.
You can also do: grep -w "OK" , which will only match the whole word "OK", for example, "1 OK", but will not match "1OK" or "OKFINE".
$ cat test.txt | grep -w "OK" 1 OK 2 OK 4 OK
source share