How do you grep and only return the matching line? i.e. The path/filename is omitted from the results.
In this case I want to look in all .bar files in the current directory, searching for the term FOO
find . -name '*.bar' -exec grep -Hn FOO {} ;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…