徐小玉的博客。
分类: LINUX
2010-07-20 10:14:45
The normal output format consists of one or more hunks of differences; each hunk shows one area where the files differ. Normal format hunks look like this:
通常输出格式包含一块或多块不同,每一块显示文件不同的区域,看起来就像这样。
change-command
< from-file-line
< from-file-line...
---
> to-file-line
> to-file-line...
There are three types of change commands. Each consists of a line number or comma-separated range of lines in the first file, a single character indicating the kind of change to make, and a line number or comma-separated range of lines in the second file. All line numbers are the original line numbers in each file. The types of change commands are:
修改命令有三种类型,每个类型的命令包含第一个文件的行或点分的行范围,一个单字符表示修改的类型,第二个文件的行或者行的范围。所有的行号使用的是在每个文件中的原始的行号。修改命令类型如下:
lar
8a12,15
means append lines 12-15 of file 2 after line 8 of file 1; or, if changing file 2 into file 1, delete lines 12-15 of file 2.
fct
5,7c8,10
means change lines 5-7 of file 1 to read as lines 8-10 of file 2; or, if changing file 2 into file 1, change lines 8-10 of file 2 to read as lines 5-7 of file 1.
rdl
5,7d3
means delete lines 5-7 of file 1; or, if changing file 2 into file 1, append lines 5-7 of file 1 after line 3 of file 2.
--ignore
options。什么都没有表示两边内容相同或者被忽略了不同。|
<
>
(
)
\
/
This is the file lao
:
The Way that can be told of is not the eternal Way;
The name that can be named is not the eternal name.
The Nameless is the origin of Heaven and Earth;
The Named is the mother of all things.
Therefore let there always be non-being,
so we may see their subtlety,
And let there always be being,
so we may see their outcome.
The two are the same,
But after they are produced,
they have different names.
This is the file tzu
:
The Nameless is the origin of Heaven and Earth;使用diff lao tuz
The named is the mother of all things.
Therefore let there always be non-being,
so we may see their subtlety,
And let there always be being,
so we may see their outcome.
The two are the same,
But after they are produced,
they have different names.
They both may be called deep and profound.
Deeper and more profound,
1,2d01,2d0 将第一个文件的1-2行删除
< The Way that can be told of is not the eternal Way;
< The name that can be named is not the eternal name.
4c2,3
< The Named is the mother of all things.
---
> The named is the mother of all things.
>
11a11,13
> They both may be called deep and profound.
> Deeper and more profound,
> The door of all subtleties!