Eduardo
Eduardo

Reputation: 21048

Option in diff to show differences in lines that include a certain word

Is there any way using diff to show differences only in lines that include an specific word?

Upvotes: 1

Views: 206

Answers (1)

Kosi2801
Kosi2801

Reputation: 23095

You can specify the option '-I regexp' to ignore the lines which match the specified regular expression. If you inverse the regex, you can ignore all lines NOT containing the word you're looking for.

See the diff manpage for more info or here for a specific example.

Upvotes: 2

Related Questions