LinuxCommandLibrary

upx

Compress executable files

TLDR

Compress executable

$ upx [path/to/file]
copy

Decompress executable
$ upx -d [path/to/file]
copy

Detailed help
$ upx --help
copy

SYNOPSIS

upx [options] [input_file]...

PARAMETERS

-1 ... -9
    Compression level; -1 is fastest compression, -9 is best compression (but slowest).

-d, --decompress
    Decompress the input file(s).

-t, --test
    Test the compressed file(s) for integrity.

-l, --list
    List compressed file(s) contents.

-q, --quiet
    Be quiet; suppress most output messages.

-v, --verbose
    Be verbose; display more detailed information.

--best
    Equivalent to -9.

--lzma
    Use LZMA compression method (better compression ratio).

--help
    Display help message.

--version
    Display version information.

DESCRIPTION

UPX is a free, portable, high-performance executable packer for several executable formats.

It achieves an excellent compression ratio (up to 50%-70%) and offers very fast decompression. UPX supports a number of different executable formats, including ELF executables used on Linux and other Unix-like systems, as well as PE files commonly used on Windows.

It's useful for reducing the disk space and download size of executables, making them more portable and faster to transfer over networks. Decompression happens in-place at runtime, adding minimal overhead to the execution time. Because of the simple decompression method, UPX is also used to analyze malware since many malicious executables are packed to avoid signature detection.

CAVEATS

Packing executables with UPX can sometimes interfere with debugging tools or cause antivirus software to flag the executable as suspicious, even if it is not malicious. Also, heavily packed executables may take slightly longer to start up, although the runtime performance after decompression is usually unaffected.

LICENSE

UPX is distributed under the GNU General Public License (GPL).

SUPPORTED ARCHITECTURES

UPX supports a wide range of architectures, including x86, x86-64, ARM, PowerPC, and others.

HISTORY

UPX was initially released in 1996 and has been actively developed and maintained since. It gained popularity as a free and open-source alternative to proprietary executable packers, and its cross-platform compatibility and high compression ratio made it widely adopted across various operating systems. Its development was driven by the need to reduce the size of executables for easier distribution and storage, especially during the early days of the internet when bandwidth was limited. Over time, UPX has been improved to support new executable formats and compression algorithms, while retaining its core principles of speed and ease of use.

The use of UPX is very prevalent for distribution of software.

SEE ALSO

strip(1), gzip(1)

Copied to clipboard