ZLESS(1)

๐Ÿ’– zless, bestie ๐Ÿ’–

okay so real quick โ€” this is the manual page for zless, and it lives in section 1 of the General Commands Manual (that's the "user commands" section, iykyk). pull up a chair, grab a strawberry ๐Ÿ“, we're doing this.


โœจ NAME โœจ

zless โ€” a file perusal filter for crt viewing of compressed text ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

zless [ name ... ]

โœจ DESCRIPTION โœจ

so zless is a filter, right? and what it does is let you look at compressed or plain text files one screenful at a time on a soft-copy terminal. like, it's giving "less but it also handles the gzipped stuff for you". ๐Ÿ‘‘

here's the tea: it is literally the equivalent of setting the environment variable LESSOPEN to:

|gzip -cdfq -- %s

and setting the environment variable LESSMETACHARS to:

<space><tab><newline>;*?"()<>[|&^`#\$%=~

โ€ฆand then just running less. that's it. that's the whole trick. ๐Ÿ’…

however โ€” and this is iconic โ€” enough people seem to think that having the command zless available is important to be worth providing it. so here we are. the people spoke. ๐Ÿซถ


๐ŸŒธ SEE ALSO ๐ŸŒธ


๐Ÿ’€ BUGS ๐Ÿ’€

okay bestie, listen up, this is the important part:

zless does NOT work with compressed data that is piped to it via standard input. it requires that input files be specified as arguments. periodt.

so if you're sitting there going cat thing.gz | zless and wondering why the universe has abandoned you โ€” that's why. ๐Ÿ˜ญ

if you genuinely need to read compressed data from a pipe, you can do this instead:

...|gunzip|less

instead of:

...|zless

no cap, that's the workaround. write it down. ๐Ÿ“


Copyright ยฉ 2006โ€“2007, 2015โ€“2026 Free Software Foundation, Inc. Copyright ยฉ 1992, 1993 Jean-loup Gailly

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.


and that's the whole page, bestie ๐Ÿ’œ this was zless, hanging out in section 1 of the General Commands Manual โ€” go forth and read your gzipped files one screenful at a time, you absolute main character ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from