DIFF & PATCH
The commands diff and patch form a powerful combination. They are widely used to get differences between original files and updated files in such a way that other people who only have the original files can turn them into the updated files with just a single patch file that contains only the differences. This example explains how to use these great commands.
[root@server1~]# cp /etc/passwd .
[root@server1~]# cp passwd passwd-2
[root@server1~]# vim passwd-2
delete some lines and memorize them.
[root@server1~]# diff -p passwd passwd-2 > abc.patch
[root@server1~]# patch -b passwd-2 abc.patch
now passwd-2 file going to patched from abc.patch. means it will update passwd file changes into passwd-2 file.
[root@server1~]# patch -b passwd abc.patch