0% found this document useful (0 votes)
28 views2 pages

Bdiff Command

The bdiff command compares two large files and identifies differences by splitting the files into segments. It outputs the differences in the same format as the diff command. Bdiff is useful when the files are too large for diff to process directly. It segments each file into blocks of 3500 lines by default and runs diff on the corresponding blocks to find differences between the files.

Uploaded by

Darko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Bdiff Command

The bdiff command compares two large files and identifies differences by splitting the files into segments. It outputs the differences in the same format as the diff command. Bdiff is useful when the files are too large for diff to process directly. It segments each file into blocks of 3500 lines by default and runs diff on the corresponding blocks to find differences between the files.

Uploaded by

Darko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Linux bdiff command

Updated: 12/29/2017 by Computer Hope

• About bdiff
• bdiff syntax
• bdiff examples
• Related commands
• Linux and Unix commands help

About bdiff
bdiff is used to identify the diffs between two very big files.

Description
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 syntax
bdiff { filename1 | - } { filename2 | - } [ number ] [ -s ]

Options
filename1 Name of first file to compare.

filename2 Name of second file to compare.

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

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

bdiff examples
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

You might also like