---
name: "bspatch"
section: "1"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/bspatch"
---

# bspatch(1)

apply a patch built with bsdiff(1)

## NAME

**bspatch** – apply a patch built with [bsdiff(1)](/bsdiff/1.md)

## SYNOPSIS

**bspatch** *oldfile* *newfile* *patchfile*

## DESCRIPTION

The **bspatch** utility generates *newfile* from *oldfile* and *patchfile* where *patchfile* is a binary patch built by [bsdiff(1)](/bsdiff/1.md).

The **bspatch** utility uses memory equal to the size of *oldfile* plus the size of *newfile*, but can tolerate a very small working set without a dramatic loss of performance.

## SEE ALSO

[bsdiff(1)](/bsdiff/1.md)

## AUTHORS

Colin Percival ⟨*cperciva@FreeBSD.org*⟩

## BUGS

The **bspatch** utility does not verify that *oldfile* is the correct source file for *patchfile*. Attempting to apply a patch to the wrong file will usually produce garbage; consequently it is strongly recommended that users of **bspatch** verify that *oldfile* matches the source file from which *patchfile* was built, by comparing cryptographic hashes, for example. Users may also wish to verify after running **bspatch** that *newfile* matches the target file from which *patchfile* was built.
