compare file A from file B, and save the content in file C

while read line; do grep -q $line A.txt || echo $line; done < B.txt >C.txt

I have got the above example, its very interesting and helpful as well. If A is the file with the first content and B is the file with the second content. It prints what is not found in the second file.

Can save output using redirection operator.

Comments

Popular posts from this blog

Xmanager RHEL 6 xclock :command not found -- Resolved

Racktable on ubuntu installation

RPM Tit-Bits ;-)