{
    "mode": "man",
    "parameter": "zcmp",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/zcmp/1/json",
    "generated": "2026-09-19T14:06:12Z",
    "synopsis": "zcmp [ cmpoptions ] file1 [ file2 ]\nzdiff [ diffoptions ] file1 [ file2 ]",
    "sections": {
        "NAME": {
            "content": "zcmp, zdiff - compare compressed files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "zcmp [ cmpoptions ] file1 [ file2 ]\nzdiff [ diffoptions ] file1 [ file2 ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  zcmp  and  zdiff  commands  are used to invoke the cmp or the diff program on files com‐\npressed via gzip.  All options specified are passed directly to cmp or diff.  If  only  file1\nis  specified,  it  is  compared  to the uncompressed contents of file1.gz.  If two files are\nspecified, their contents (uncompressed if necessary) are fed to  cmp  or  diff.   The  input\nfiles are not modified.  The exit status from cmp or diff is preserved.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "cmp(1), diff(1), zmore(1), zgrep(1), znew(1), zforce(1), gzip(1), gzexe(1)\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Messages  from the cmp or diff programs may refer to file names such as \"-\" instead of to the\nfile names specified.\n\nZDIFF(1)",
            "subsections": []
        }
    },
    "summary": "zcmp, zdiff - compare compressed files",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "cmp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/cmp/1/json"
        },
        {
            "name": "diff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/diff/1/json"
        },
        {
            "name": "zmore",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/zmore/1/json"
        },
        {
            "name": "zgrep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/zgrep/1/json"
        },
        {
            "name": "znew",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/znew/1/json"
        },
        {
            "name": "zforce",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/zforce/1/json"
        },
        {
            "name": "gzip",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gzip/1/json"
        },
        {
            "name": "gzexe",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gzexe/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Compare compressed files.",
        "examples": [
            {
                "description": "Invoke `cmp` on two files compressed via `gzip`",
                "command": "zcmp {{path/to/file1.gz}} {{path/to/file2.gz}}"
            },
            {
                "description": "Compare a file to its gzipped version (assuming `.gz` exists already)",
                "command": "zcmp {{path/to/file}}"
            }
        ]
    }
}