It is also possible to decompress it using standard shell-script + gzip, if you don't have, or want to use openssl or other tools.
The trick is to prepend the gzip magic number and compress method to the actual data from zlib.compress:

printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - /tmp/data |gzip -dc >/tmp/out

Edits:
@d0sboots commented: For RAW Deflate data, you need to add 2 more null bytes:
โ†’ "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00"

This Q on SO gives more information about this approach. An answer there suggests that there is also an 8 byte footer.

Users @Vitali-Kushner and @mark-bessey reported success even with truncated files, so a gzip footer does not seem strictly required.

@tobias-kienzler suggested this function for the bashrc:
zlibd() (printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" | cat - "$@" | gzip -dc)

Answer from wkpark on Stack Exchange
๐ŸŒ
Ubuntu
manpages.ubuntu.com โ€บ focal โ€บ man(3)
Ubuntu Manpage: zlib - compression and decompression operations
The transformation can be removed again with chan pop. The mode argument determines what type of transformation is pushed; the following are supported: ... The transformation will be a compressing transformation that produces zlib-format data on channel, which must be writable.
Discussions

linux - How to run zlib from terminal on Ubuntu? - Unix & Linux Stack Exchange
I've installed zlib1g but still zlib isn't available from the terminal. How can I find the executable to run it? Or is there an easier way I'm overlooking? The reason for this is that I want to com... More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
September 28, 2022
Zlib uncompression for an noob

Looks like zlib compressed data, here's more info how to deflate it: https://unix.stackexchange.com/questions/22834/how-to-uncompress-zlib-data-in-unix

More on reddit.com
๐ŸŒ r/LiveOverflow
5
6
March 27, 2020
blob - How can I DEFLATE with a command line tool to extract a Git object? - Stack Overflow
Related question for people who ... want to decompress data with cURL: stackoverflow.com/questions/8364640/โ€ฆ ... Save this answer. ... Show activity on this post. Something like the following will print the raw content, including the "$type $length\0" header: perl -MCompress::Zlib -e 'undef ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
red lang - How to decompress/deflate zlib data [rfc1951]? - Stack Overflow
I am looking for decompressing data according to the deflate compression mechanism [rfc1951]. The linux command for this mechanism is: zlib-flate -uncompress I try the Red command decompress with More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
GitHub
github.com โ€บ kevin-cantwell โ€บ zlib
GitHub - kevin-cantwell/zlib: A command-line utility for quickly compressing or decompressing zlib data. ยท GitHub
Without any arguments, zlib will compress an input stream. Use the -d flag for decompression.
Starred by 48 users
Forked by 4 users
Languages ย  Go
๐ŸŒ
Jyotiprakash's Blog
blog.jyotiprakash.org โ€บ file-compression-and-decompression-in-c-using-zlib
File compression and decompression in C using ZLib
December 31, 2023 - To create a C program that uses Zlib to compress or decompress a file based on command-line arguments, you need to follow these steps: Install Zlib for Development on Ubuntu: Open a terminal and run the following command to install Zlib development...
๐ŸŒ
Ubuntu Manpages
manpages.ubuntu.com โ€บ manpages โ€บ focal โ€บ man1 โ€บ zlib_decompress.1.html
Ubuntu Manpage: zlib_decompress - decompress mysqlpump ZLIB-compressed output
output_file Example: mysqlpump --compress-output=ZLIB > dump.zlib zlib_decompress dump.zlib dump.txt To see a help message, invoke zlib_decompress with no arguments. To decompress mysqlpump LZ4-compressed output, use lz4_decompress.
๐ŸŒ
Ubuntu
manpages.ubuntu.com โ€บ trusty โ€บ man(1)
Ubuntu Manpage: zlib-flate - raw zlib compression program
The zlib-flate program reads from standard input and writes to standard output either compressing or uncompressing its input using raw zlib compression. It can be used to uncompress or compress raw PDF streams or other data that is compressed with raw zlib compression.
๐ŸŒ
Ubuntu
manpages.ubuntu.com โ€บ manpages โ€บ focal โ€บ en โ€บ man3 โ€บ zlib.3.html
Ubuntu Manpage: zlib - compression/decompression library
zlib library is a general purpose data compression library. The code is thread safe, assuming that the standard library functions used are thread safe, such as memory allocation routines. It provides in- memory compression and decompression functions, including integrity checks of the uncompressed ...
Find elsewhere
๐ŸŒ
Linuxbase
refspecs.linuxbase.org โ€บ LSB_3.0.0 โ€บ LSB-Core-generic โ€บ LSB-Core-generic โ€บ zlib-uncompress-1.html
uncompress - Linux Foundation Referenced Specifications
int uncompress(Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen); ยท The uncompress() function shall attempt to uncompress sourceLen bytes of data in the buffer source, placing the result in the buffer dest
๐ŸŒ
LinuxVox
linuxvox.com โ€บ blog โ€บ zlib-ubuntu
Zlib on Ubuntu: A Comprehensive Guide โ€” linuxvox.com
... Zlib is a compression library that implements the deflate compression algorithm, which is a combination of LZ77 and Huffman coding. It provides a simple API for compressing and decompressing data streams.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 69105129 โ€บ how-to-decompress-deflate-zlib-data-rfc1951
red lang - How to decompress/deflate zlib data [rfc1951]? - Stack Overflow
I am looking for decompressing data according to the deflate compression mechanism [rfc1951]. The linux command for this mechanism is: zlib-flate -uncompress I try the Red command decompress with
๐ŸŒ
MajorGeeks
forums.majorgeeks.com โ€บ threads โ€บ zlib-uncompression-for-an-idiot.223640
Zlib uncompression for an idiot? | MajorGeeks.Com Support Forums
September 25, 2010 - I want to uncompress a ZLIB-compressed file, without any programming skill. Could some of you give me exact help?
๐ŸŒ
Unix.com
unix.com โ€บ applications โ€บ programming
uncompress of zlib - Programming - Unix Linux Community
October 20, 2017 - When I gzopen & gzread from a gzip file, it works OK. But I when I try to uncompress the same data from memory (either by reading to memory with fread or mmap()ing) using decompress, I get Z_DATA_ERROR. Is it because gziโ€ฆ
๐ŸŒ
SysTutorials
systutorials.com โ€บ docs โ€บ linux โ€บ man โ€บ n-zlib
zlib: compression and decompression operations - Linux Manuals (n)
Pushes a compressing or decompressing transformation onto the channel channel. The transformation can be removed again with chan pop. The mode argument determines what type of transformation is pushed; the following are supported: ... The ...
๐ŸŒ
Certsimple
certsimple.com โ€บ how-to-use-zlib-in-linux
And Zlib-decompress Commands To Compress ...
April 16, 2022 - Online casinos Canada players can make the best of in 2026, ranked by bonuses, games, payouts, and Interac support across top-rated sites.