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
now passwd file going to patched from abc.patch. means it will update passwd-2 file changes into passwd file.

To know about the courses CLICK HERE..!!

Contact US CLICK HERE..!!

1 comment:

  1. Awesome post red hat training institute in noida. Its so much informative for the followers. I like the way you describe this post. Its really helpful for the users of this site. I am also searching about these type of sites now a days. So your site really helps me for searching the new and great stuff. This site contain all my specifications. Thanks for sharing. Keep it up. I am waiting for your more posts like this or related to any other informative topic.