# man > zdiff(1)

> **TLDR:** Invoke `diff` on `gzip` archives.
>
- Compare two files, uncompressing them if necessary:
  `zdiff {{path/to/file1.gz}} {{path/to/file2.gz}}`
- Compare a file to a `gzip` archive with the same name:
  `zdiff {{path/to/file}}`

*Source: tldr-pages*

---

[_ZDIFF_(1)](https://www.chedong.com/phpMan.php/man/ZDIFF/1/markdown)                               General Commands Manual                              [_ZDIFF_(1)](https://www.chedong.com/phpMan.php/man/ZDIFF/1/markdown)

## NAME
       zcmp, zdiff - compare compressed files

## SYNOPSIS
       **zcmp **[ cmp_options ] file1 [ file2 ]
       **zdiff **[ diff_options ] file1 [ file2 ]

## DESCRIPTION
       The  **zcmp  **and  **zdiff  **commands  are used to invoke the **cmp **or the **diff **program on files com‐
       pressed via **gzip**.  All options specified are passed directly to **cmp **or **diff**.  If  only  _file1_
       is  specified,  it  is  compared  to the uncompressed contents of _file1_**.gz_**._  If two files are
       specified, their contents (uncompressed if necessary) are fed to  **cmp  **or  **diff**.   The  input
       files are not modified.  The exit status from **cmp **or **diff **is preserved.

## SEE ALSO
       [cmp(1)](https://www.chedong.com/phpMan.php/man/cmp/1/markdown), [diff(1)](https://www.chedong.com/phpMan.php/man/diff/1/markdown), [zmore(1)](https://www.chedong.com/phpMan.php/man/zmore/1/markdown), [zgrep(1)](https://www.chedong.com/phpMan.php/man/zgrep/1/markdown), [znew(1)](https://www.chedong.com/phpMan.php/man/znew/1/markdown), [zforce(1)](https://www.chedong.com/phpMan.php/man/zforce/1/markdown), [gzip(1)](https://www.chedong.com/phpMan.php/man/gzip/1/markdown), [gzexe(1)](https://www.chedong.com/phpMan.php/man/gzexe/1/markdown)

## BUGS
       Messages  from the **cmp **or **diff **programs may refer to file names such as "-" instead of to the
       file names specified.

                                                                                            [_ZDIFF_(1)](https://www.chedong.com/phpMan.php/man/ZDIFF/1/markdown)
