Display exact matches only with grep

You need a more specific expression. Try grep ” OK$” or grep “[0-9]* OK”. You want to choose a pattern that matches what you want, but won’t match what you don’t want. That pattern will depend upon what your whole file contents might look like. You can also do: grep -w “OK” which will only match a whole word “OK”, … Read more

Display exact matches only with grep

ou need a more specific expression. Try grep ” OK$” or grep “[0-9]* OK”. You want to choose a pattern that matches what you want, but won’t match what you don’t want. That pattern will depend upon what your whole file contents might look like. You can also do: grep -w “OK” which will only match a whole word “OK”, … Read more