In Awk, there is the operation ~ which checks a string against a regex. Regexes are written as the regex in between two slashes.
And in Awk $1, $2, $3 represent the Nth field in a separated line, while $0 contains the whole line.
So to put this all together, one can print the lines which contain "selected" by using
By default, if there is no command for what to do on a matching line, the line is printed.
If you need to only print the first line with the word "selected", you would need to add the command