Grep Regex: List all lines except

Solution 1:

That should do it:

grep -v 'T[^H]'

-v : print lines not matching

[^H]: matches any character but H

Solution 2:

You can do:

grep -v 'T[^H]' input

-v is the inverse match option of grep it does not list the lines that match the pattern.

The regex used is T[^H] which matches any lines that as a T followed by any character other than a H.