I am trying to find data from files using grep, but grep usually prints out the filename as well as the line where the term is found.

In this case, I am looking for a special regexp and I want grep to print all items matching the regexp, not the line or the filename. In other words, I want to see only the matched regular expression.

1 Answer 1


With GNU grep, that's the -o option possibly combined with -h to suppress the filename.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .