1833770 Members
2456 Online
110063 Solutions
New Discussion

Re: diff but ....

 
SOLVED
Go to solution
f. halili
Trusted Contributor

diff but ....

i want to see the difference between two files ( file1 & file2 ), but i want only to see the lines that are unique on file2.

thanks,
f. halili
derekh
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: diff but ....

Hi:

# diff f1 f2|grep ">"

Regards!

...JRF...
f. halili
Trusted Contributor

Re: diff but ....

worked great! thanks!
derekh
Biswajit Tripathy
Honored Contributor

Re: diff but ....

That solution would work if you don't have '>' char as part of any unique line in file1. A better solution would be :

# diff f1 f2 | grep "^>"

- Biswajit
:-)
john korterman
Honored Contributor

Re: diff but ....

Hi,

if the two files are sorted, this should also produce the correct result:

$ comm -13 file1 file2

regards,
John K.
it would be nice if you always got a second chance
f. halili
Trusted Contributor

Re: diff but ....

thanks everyone. all worked well.
derekh