我想让(GNU)DIFF仅打印出一个文件中不同的行。因此给定
==> diffa.txt <==
line1
line2 - in a only
line3
line4 changed
line5
==> diffb.txt <==
line1
line3
line4 changed in b
line5
line6 in b only
我想diff --someoption diffa.txt diffb.txt
生产
line2 - in a only
line4 changed
以下内容似乎应该会有所帮助,但这有点神秘:
--GTYPE-group-format=GFMT
Similar, but format GTYPE input groups with GFMT.
--line-format=LFMT
Similar, but format all input lines with LFMT.
--LTYPE-line-format=LFMT
Similar, but format LTYPE input lines with LFMT.
LTYPE is `old', `new', or `unchanged'.
GTYPE is LTYPE or `changed'.
GFMT may contain:
%< lines from FILE1
%> lines from FILE2
手册页在这些标志上肯定有点简洁!好问题。
—
quickshiftin
我想指出的是,“ info diff”将给出完整的示例,info中包含大量信息。
—
Baroudi Safwen '16