gzip, gunzip, zcat

Randy Hron rwhron at earthlink.net
Tue Mar 13 17:22:35 PST 2001

In LFS 3.0 pre (and perhaps everywhere)...

gzip, gunzip, and zcat are 3 names for the same executable.
It changes behavior depending on which command is used.

Anyway, the tip:

after moving gzip and gunzip to $LFS/bin:

ln -f $LFS/bin/gzip $LFS/bin/gunzip
ln -f $LFS/bin/gzip $LFS/bin/zcat

(zcat belongs in /bin with gzip and gunzip per the FHS 2.2 beta).
This example uses hard links rather than symbolic links.
Hard links are slightly faster and use the same space as a symlink,
(just a directory entry).

So the command snippet in chapter 5 could become:

patch -Np1 -i ../gzip-1.2.4a.patch &&
 ./configure --prefix=$LFS/usr &&
 make LDFLAGS=-static &&
 make install &&
 mv $LFS/usr/bin/gunzip $LFS/usr/bin/gzip $LFS/usr/bin/zcat $LFS/bin &&
 ln -f $LFS/bin/gzip $LFS/bin/gunzip &&
 ln -f $LFS/bin/gzip $LFS/bin/zcat

In chapter 6 the commands could be:

./configure --prefix=/usr &&
 make &&
 make install &&
 cd /usr/bin &&
 mv gzip gunzip zcat /bin &&
 cd /bin &&
 ln -f gzip gunzip &&
 ln -f gzip compress &&
 ln -f gzip uncompress &&
 ln -f gzip zcat


Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message

More information about the lfs-dev mailing list