LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

upx

Ultimate Packer for eXecutables

TLDR

Compress executable
$ upx [program]
copy
Compress with best ratio
$ upx --best [program]
copy
Compress with fastest speed
$ upx -1 [program]
copy
Decompress executable
$ upx -d [program]
copy
Test compressed file
$ upx -t [program]
copy
List compression info
$ upx -l [program]
copy
Keep backup
$ upx -k [program]
copy
Compress quietly
$ upx -q [program]
copy
Compress to a different output file
$ upx -o [packed_program] [program]
copy

SYNOPSIS

upx [-d] [-t] [-l] [--best] [-1..-9] [options] files

DESCRIPTION

upx (Ultimate Packer for eXecutables) compresses executables. Compressed programs decompress in memory when run.Compression reduces file size significantly, often 50-70% for binaries. This saves disk space and download bandwidth.The compressed executable is self-extracting. It decompresses to memory at load time without user intervention.Multiple executable formats are supported: Linux ELF, Windows PE, macOS Mach-O, and others.Decompression is fast with minimal runtime overhead. The original executable behavior is preserved exactly.Testing verifies compressed files are valid. This catches corruption before deployment.

PARAMETERS

-1 to -9

Compression level (1=fast, 9=best).
--best
Alias for -9, best compression ratio.
--brute
Try all compression methods and filters (very slow).
--ultra-brute
Even more exhaustive search (extremely slow).
-d
Decompress.
-t
Test integrity.
-l
List compression info.
-k
Keep backup file.
-o FILE
Output to file.
-f
Force compression.
-q
Quiet mode.
-v
Verbose mode.
--no-backup
Don't create backup.
--lzma
Use LZMA compression (better ratio but slower decompression).
--no-lzma
Disable LZMA compression (overrides --brute and --all-methods).
--overlay=ACTION
Handle overlay data: copy (default), strip.

CAVEATS

Some security tools flag UPX-compressed files. Code signing may be invalidated. Slight startup overhead from decompression. Some formats not supported.

HISTORY

UPX was created by Markus Oberhumer, László Molnár, and John Reiser in 1996. It became the standard tool for executable compression, widely used for software distribution.

SEE ALSO

strip(1), gzip(1), objcopy(1)

Copied to clipboard
Kai