开发者

unix diff command question

开发者 https://www.devze.com 2023-02-10 18:54 出处:网络
I got two files. I want to use diff to compare those to see what has been changed. I checked 开发者_运维技巧man diff but there are log of options. Could anyone give me a quick hint what should I do?

I got two files. I want to use diff to compare those to see what has been changed. I checked 开发者_运维技巧man diff but there are log of options. Could anyone give me a quick hint what should I do? thank you you all!!


$ diff -u module.erl.orig module.erl.new

will give you a differences between files in unified form. You can also save them to a file

$ diff -u module.erl.orig module.erl.new > module.erl.patch

And patch an original file to have these changes:

$ patch -p module.erl.orig < module.erl.patch


Simple: diff path/to/file1 path/to/file2

0

精彩评论

暂无评论...
验证码 换一张
取 消