Open gzipped file with vi?

If you are using latest (and greatest) vi/vim then it can open gzipped files (those with extension .gz) automagically, but it’s not so easy if you must use some old/outdated system where is also old vi/vim.

So, what to do? Gunzipping is sometimes impossible (no gunzip? not enough free space? readonly system? too many files to just search through…). Use zcat!

$ zcat filename.gz | vi -

That’s not all!
gzip package (on Gentoo : app-arch/gzip) contains many more commands useful with .gz files, for example:

* zcmp – binary-compare two gzipped files
* zdiff – compare two gzipped files
* zgrep, zegrep, zfgrep – grep in gzipped files
* zless, zmore – do less and more on gzipped files

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Exaptcha (all lowercase letters) reload *