Michael Kahle <email@example.com> writes:
> I was looking at some of the gzip'd documentation in
> /usr/share/doc/exim today and I got to wondering... When I want to
> view the documentation, I would always change to root, then
> uncompress the file, read it, and then re-compress it. Am I making
> this too difficult? Is there another utility that I should be using
> to browse this documentation so that I don't have to go through all
> of these steps every time?
You can use 'zcat' or 'zless' to directly read a gzipped text file.
Some other hints:
-- I have LESSOPEN='|/usr/bin/lesspipe %s', which causes 'less' to be
clever about automatically gunzipping files for me.
-- 'zcat foo.ps.gz | gv -' might work to display gzipped PostScript,
though you won't be able to page backwards.
-- 'cp foo.ps.gz /tmp; gunzip /tmp/foo.ps; gv /tmp/foo.ps' uses a
temporary file to the same end, without being root.
-- For things that aren't text files, 'see foo.ps.gz' will use the
default MIME viewer for a particular extension to look at files.
-- In zsh (don't know about other shells), there's lots of useful
command-line substitutions; I do 'xpdf =(zcat foo.pdf.gz)' all the
time. (zsh generates a temporary file with the uncompressed
contents; <(...) would work if I just needed a pipe.)
David Maze firstname.lastname@example.org http://people.debian.org/~dmaze/
"Theoretical politics is interesting. Politicking should be illegal."
-- Abra Mitchell