Linux command
upx 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Compress executable
upx [program]
Compress with best ratio
upx --best [program]
Compress with fastest speed
upx -1 [program]
Decompress executable
upx -d [program]
Test compressed file
upx -t [program]
List compression info
upx -l [program]
Keep backup
upx -k [program]
Compress quietly
upx -q [program]
Compress to a different output file
upx -o [packed_program] [program]
说明
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.
参数
- -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.
FAQ
What is the upx command used for?
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.
How do I run a basic upx example?
Run `upx [program]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -1 to -9 do in upx?
Compression level (1=fast, 9=best).