---
name: "gzexe"
section: "1"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["linux", "freebsd", "openbsd"]
url: "https://carta.tech/man/gzexe"
---

# gzexe(1)

create auto-decompressing executables

## NAME

**gzexe** – create auto-decompressing executables

## SYNOPSIS

**gzexe** \[**-d**\] *file ...*

## DESCRIPTION

The **gzexe** utility uses [gzip(1)](/man/gzip/1.md) to compress executables, producing executables that decompress on-the-fly when executed. This saves disk space, at the cost of slower execution times. The original executables are saved by copying each of them to a file with the same name with a ‘~’ suffix appended. After verifying that the compressed executables work as expected, the backup files can be removed.

The options are as follows:

- **-d**

  Decompress executables previously compressed by **gzexe**.

The **gzexe** program refuses to compress non-regular or non-executable files, files with a setuid or setgid bit set, files that are already compressed using **gzexe**, files in */bin* or */sbin*, or programs it needs to perform on-the-fly decompression: [sh(1)](/man/sh/1.md), [basename(1)](/man/basename/1.md), [mktemp(1)](/man/mktemp/1.md), [rm(1)](/man/rm/1.md), [echo(1)](/man/echo/1.md), [tail(1)](/man/tail/1.md), [gzip(1)](/man/gzip/1.md), and [chmod(1)](/man/chmod/1.md).

## SEE ALSO

[compress(1)](/man/compress/1.md), [gzip(1)](/man/gzip/1.md)

## CAVEATS

The **gzexe** utility replaces files by overwriting them with the generated compressed executable. To be able to do this, it is required that the original files are writable.
