Turbulent Sky
Tech Tips, Tricks and Solutions

by

The zcat command line program in OS X has been broken for quite some time and is still that way in Snow Leopard. When trying to output the contents of a gzipped file, zcat appends .Z to the end of the file name that it’s given and outputs an error. The quick fix is to replace it with gzcat as follows:

$ cd /usr/bin
$ sudo mv zcat broken-zcat
$ sudo ln -s gzcat zcat

This process renames the original zcat program to broken-zcat and then creates a symbolic link called zcat that points to gzcat. This way, you don’t have to remember to specifically use gzcat. Running zcat will also use gzcat.

Post a comment

Post Comment

Please note: Comments are moderated by an Admin and may not be publicly visible right away.


Creative Commons License This work by Peter Ridge is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.
Turbulent Sky Theme by Peter Ridge, based on BlueMod Theme by FrederikM.de