Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Can someone tell me if linux diff command can ignor difference in line which have some word (example: CET)


<     <set name="ti_zone">CET</set>
>     <set name="time_zone">CET</set>

In this example I would like to ignore this difference...

if can do this, can you give me an example?

Br, Wolfy

share|improve this question

2 Answers 2

Just pipe the output through grep.

diff .... | grep -v CET

share|improve this answer
up vote 5 down vote accepted

Actually I find a solution :)

Diff can do this...

diff -w -I CET file1 file2

BR, Wolfy

share|improve this answer
way cool. thanks for sharing! –  pbr Oct 14 '10 at 8:09
Accept it as an answer. –  Marius Gedminas Oct 14 '10 at 9:21
can't do this, I must wait 2 days... –  Wolfy Oct 15 '10 at 6:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.