Sometimes we need to read the content of compressed files without extracting them, especially when dealing with large documents like plain text logs. In this case the amount of time and resources taken for decompression can be bothersome. The appropriate tools are located in /bin directory :

ls /bin/z*

Command Description
zcatDisplays compressed files (like .gz) to stdout, similar to cat but for compressed files.
zdumpPrints the current time in each timezone specified or all timezones if none are given.
zenityDisplays GTK+ dialog boxes for shell scripts (e.g., file selection, progress bars, messages).
zgrepSearches for patterns in compressed files (like grep, but works on .gz files).
zipdetailsDisplays detailed information about a ZIP file’s internal structure.
zipnoteEdits comments in a ZIP file.
zlessViews compressed files (like .gz) interactively, similar to less.
zstdA fast lossless compression tool and format (zstandard).
zstdlessViews files compressed with zstd, similar to less.
zcmpCompares compressed files (like cmp, but works on .gz files).
zegrepSearches for patterns in compressed files, using extended regular expressions (like egrep).
zfgrepSearches for fixed strings in compressed files (like fgrep).
zipPackage and compress files into a ZIP archive.
zipgrepSearches for patterns in files within a ZIP archive (like grep).
zipsplitSplits a ZIP archive into smaller archives of a specified size.
zmoreViews compressed files (like .gz) page by page, similar to more.
zstdcatDecompresses and concatenates zstd-compressed files to stdout.
zstdmtMulti-threaded version of zstd for faster compression/decompression.
zdiffCompares compressed files line by line (like diff, but works on .gz files).
zeisstopnmConverts Zeisstop image files to portable anymap (PNM) format.
zforceForces a .gz extension on all gzipped files in the current directory.
zipcloakEncrypts files in a ZIP archive (note: weak encryption, use with caution).
zipinfoLists detailed information about files in a ZIP archive.
zjsdecodeDecodes files encoded with the JS encoding (used in some web contexts).
znewRecompresses .Z files to .gz format for better compression.
zstdgrepSearches for patterns in zstd-compressed files (like grep).


Examples : A large 1.5Gb log file is created in seconds using the yes command :

With zmore the response is very fast and gives lines from the log file test.log :



Using zgrep, gives a response if the string is found, and no output in case of failure :

Previous Post Next Post