If I have a file that looks something like this eg called myfile.log
1 entry1 # Blah blah
2 entry2 # Blah blah
3 entry3 # Blah blah
4 entry4 # Blah blah
5 myentry5 # Blah blah
6 myentry6 # Blah blah
7 yourentry7 # Blah blah
8 yourentry8 # Blah blah
9 ourentry9 # Blah blah
10 ourentry10 # Blah blah
How would I extract only the words containing "entry" so output should look something like
entry1
entry2
entry3
entry4
myentry5
myentry6
yourentry7
yourentry8
ourentry9
ourentry10
Tried various grep, sed, awk commands already but just can get exactly what I want, it either outputs everything on teh line, or I get it just to say entry instead of everything containing entry
Edit - file looks like this in reality(sanitized) - Need to extract all entries with RTR
10.0.0.1 MYRTR001 # Router in Raleigh
10.0.0.2 MYSW100 # Switch in Raleigh
10.0.0.3 MYRTR002 # Router in Houston
10.0.0.4 MYSW001 # Switch in Houton
entry(orRTR- pick one and stick with it, don't muddy your question by initially saying 1 thing and then later changing) in the comments at the end of the line but not in the 2nd field, e.g.1 foobar # wish there was an entryas all existing answers would match onentryin the comments which I suspect you don't want to happen.