一、制作补丁:
diff -urP from-file to-file
If from-file is a directory and to-file is not, diff compares the file in from-file whose file name is that of to-file, and vice versa.
If both from-file and to-file are directories, diff compares corresponding files in both directories, in alphabetical order; this comparison is not recursive unless the -r or --recursive option is given.
补丁的制作是有“方向性”的。 这样制作的是用于从 from-file 生成 to-file 的补丁。
-u
Use the unified output format.
-r
When comparing directories, recursively compare any subdirectories found.
-P
When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other.
二、打补丁:
patch -s -p1 -b --suffix .bak --fuzz=0 [-R] < patch
-s or --silent or --quiet
Work silently, unless an error occurs.
-pnum or --strip=num
Strip the smallest prefix containing num leading slashes from each file name found in the patch file. This controls how file names found in
the patch file are treated, in case you keep your files in a different directory than the person who sent out the patch.
Whatever you end up with is looked for either in the current directory, or the directory specified by the -d option.
-b or --backup
Make backup files.
-z suffix or --suffix=suffix
Use suffix as the simple backup suffix.
-F num or --fuzz=num
Set the maximum fuzz factor.
ntpdate stdtime.hk
阅读(654) | 评论(0) | 转发(0) |