bdiff (计算并报告两个非常大文件的差异)

rose1 发表于 2020-08-14 17:13
浏览次数:
在手机上阅读

在类似Unix的操作系统上,bdiff命令计算并报告两个非常大文件的差异。 注意:Bdiff是Unix传家宝(旧版)命令,可能无法通过操作系统的程序包管理器进行安装。

查看英文版

目录

1 bdiff 运行系统环境

2 bdiff 说明

3 bdiff 语法

4 bdiff 例子

bdiff 运行系统环境

Linux

bdiff 说明

bdiff命令比较由指定的文件文件名1和文件名2参数,并写入约其不同的线,以标准输出信息。如果两个文件名中的任何一个为-(一个破折号),则bdiff将从标准输入中读取。该则bdiff命令用于类似的diff命令查找必须在两个文件来更改线路,使他们一致。但是,有些文件太大而无法处理diff,因此可以在其中使用bdiff

bdiff忽略两个文件开头共同的行,将每个文件的其余部分分成每个数字行段,然后告诉diff比较相应的段。缺省情况下,number参数为3500行。在某些情况下,即使一次3500行也太大,diff无法使用;如果diff失败,请尝试为number使用较小的值。

bdiff的输出与正常diff输出的格式相同,不同之处在于bdiff的行号经过调整以适应文件的分段。应该注意的是,由于文件是分段的,因此bdiff不一定会找到最小的文件差异集。

The bdiff command compares the files specified by the filename1 and filename2 parameters and writes information about their differing lines to standard output. If either file name is - (a single dash), bdiff reads from standard input. The bdiff command is used like the diff command to find lines that must be changed in two files to make them identical. Some files are too large for diff to process, however, and that's where bdiff can be used.

bdiff ignores lines common to the beginning of both files, splits the remainder of each file into segments of number lines each, and then tells diff to compare the corresponding segments. By default, the number parameter is 3500 lines. In some cases, even 3500 lines at a time is too large for diff to work with; if diff fails, try using a smaller value for number.

Output of bdiff has the same format as normal diff output, except bdiff line numbers are adjusted to account for the segmenting of the files. It should be noted that because the files are segmented, bdiff does not necessarily find the smallest possible set of file differences.

查看英文版

查看中文版

bdiff 语法

bdiff { filename1 | - } { filename2 | - } [ number ] [ -s ]

选件

文件名1

要比较的第一个文件的名称。

文件名2

要比较的第二个文件的名称。

指定每个文件应细分为的行数。缺省情况下,number为3500

-s

告诉bdiff保持静音(无诊断输出)。但是,这不会抑制diff本身可能发出的诊断消息。

bdiff { filename1 | - } { filename2 | - } [ number ] [ -s ]

Options

filename1

Name of first file to compare.

filename2

Name of second file to compare.

number

Specifies the number of lines each file should be segmented into. The value of number is 3500 by default.

-s

Tells bdiff to be silent (no diagnostic output). However, this does not suppress possible diagnostic messages from diff itself.

查看英文版

查看中文版

bdiff 例子

bdiff myfile1.txt myfile2.txt

比较文件myfile1.txtmyfile2.txt。结果的格式将类似于以下输出:

1c1
< is this ln
---
> test
3,5d2
< Hello world
< this is a test
< of the bdiff file
bdiff myfile1.txt myfile2.txt

Compare the files myfile1.txt and myfile2.txt. Results will be formatted similar to the following output:

1c1
< is this ln
---
> test
3,5d2
< Hello world
< this is a test
< of the bdiff file

查看英文版

查看中文版

其他命令行

basename | bc | bfs | bg | biff | bs | break |

如此好文,分享给朋友
发表评论
验证码:
评论列表
共0条