On Sat, Jan 30, 2010 at 10:11 AM, jellybean stonerfish <stonerf...@geocities.com> wrote: > On Fri, 29 Jan 2010 09:20:22 -0600, Peng Yu wrote: > >> It seems that diff can not do comparison on the decompressed files in >> .gz and .bz2 files. I could first decompress the .gz and .bz2 file and >> then do the comparison. But it would be convenient to be able to >> directly compare without explicitly decompressing any files. Could >> somebody add this feature to diff? > > You could make a little script pretty easy. > > $ cat /home/js/bin/gzbzdiff > #!/bin/bash > > mkfifo gzi > mkfifo bzi > > gunzip -c $1 > gzi & > bunzip2 -c $2 > bzi & > diff -s bzi gzi > rm bzi gzi > > $ gzbzdiff nsd.gz nsd.bz2 > Files bzi and gzi are identical
Of course, I could. But I think this may not be an efficient way if the .gz file is too large, say of the order of GB.