I have a file with several lines and would like to output a single word from it. e.g.
bla bla bla bla
WORD1 bla ldskjf sldfkj 0xksjdflksjflksjf
From this file, I would like to output only the word 0xksjdflksjflksjf.
I am thinking of a command that would look for the line starting by WORD1 and then, looking for a word starting by 0x in this line.
I'm quite sure that awk or sed would allow me to do that.
I found a way to do it but it doesn't very "clean":
awk '/^WORD1/ {print $5}'
It works but is there a better (e.g. based on the word pattern instead of its place in the line) way to do it?