Last Updated : 11 Jul, 2025
The
bzcmputility is used to invoke the
cmputility on bzip2 compressed files. All options specified are passed directly to
cmp. As internally
bzcmpcalls
cmp, We can pass the
cmpcommand options to
bzcmp.
bzcmp [cmp_options] file [file]Example 1:
Comparing two files as follows:
In the above example, bzcmp compares the
file1.bz2
and
file2.bz2
and returns the first-byte position where the data differs.
Example 2:Here, we will use
bzcmpwith Single parameter. Edit the compressed file
file1.bz2
and replace the content from "
GeeksForGeeks bzcmp example file1.
" to "
GeeksForGeeks bzcmp example file1 changed.
" and execute the following command. bzcmp utility compares the
file1.bz2and file1.
Note:The output from
cmprefers to temporary file name instead of a specified filename. To check the difference of contents in compressed(bz2) files you can use
bzdiffcommand.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4