linux diff命令
diff命令可以比较两个相同文件进而生成patch文件
使用如下命令获得命令的帮助
didff --help
使用以下option
-u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context
-r, --recursive recursively compare any subdirectories found
-N, --new-file treat absent files as empty
-a, --text treat all files as text
整个命令如下
diff -Naru file_old file_new > differences.patch