并排(side-by-side)格式雖然對于創建源代碼補丁來說沒有什么用處,但是用它直接比較源代碼文件比較容易,因為它把srcfile和dstfile的內容并排顯示在屏幕上.
ivan@debian $diff -y -W 80 hello.c howdy.c
#include
<stdio.h> #include
<stdio.h>
> #include
<stdlib.h>
int main(void) int
main(void)
{ {
char msg[] = "Hello,
Linux pr | char msg[] = "Hello, Linux
pr
puts(msg);
printf("Here
you are, using d | printf("Here you are, using d
return
0; | exit(EXIT_SUCCESS);
}
字符">"表示該行在dstfile而不在srcfile里.類型地,字符"<"表示該行在srcfile而不在dstfile里.字符"|"標記出兩個文件不相同的行.