{
    "content": [
        {
            "type": "text",
            "text": "# zgrep (man)\n\n## NAME\n\nzgrep - search possibly compressed files for a regular expression\n\n## SYNOPSIS\n\nzgrep [ grepoptions ] [ -e ] pattern filename...\n\n## DESCRIPTION\n\nThe  zgrep  command  invokes  grep on compressed or gzipped files.  All options specified are\npassed directly to grep.  If no file is specified, then the standard input is decompressed if\nnecessary and fed to grep.  Otherwise the given files are uncompressed if necessary  and  fed\nto grep.\n\n## TLDR\n\n> Grep text patterns from files within compressed files.\n\n- Grep a pattern in a compressed file (case-sensitive):\n  `zgrep {{pattern}} {{path/to/compressed_file}}`\n- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:\n  `zgrep {{-context|--before-context|--after-context}} 3 {{pattern}} {{path/to/compressed_file}}`\n- Grep a pattern in a compressed file (case-insensitive):\n  `zgrep {{-i|--ignore-case}} {{pattern}} {{path/to/compressed_file}}`\n- Output count of lines containing matched pattern in a compressed file:\n  `zgrep {{-c|--count}} {{pattern}} {{path/to/compressed_file}}`\n- Display the lines which don't have the pattern present (Invert the search function):\n  `zgrep {{-v|--invert-match}} {{pattern}} {{path/to/compressed_file}}`\n- Grep a compressed file for multiple patterns:\n  `zgrep {{-e|--regexp}} \"{{pattern_1}}\" {{-e|--regexp}} \"{{pattern_2}}\" {{path/to/compressed_file}}`\n- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`):\n  `zgrep {{-E|--extended-regexp}} {{regex}} {{path/to/file}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXIT STATUS**\n- **BUGS**\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "zgrep",
        "section": "",
        "mode": "man",
        "summary": "zgrep - search possibly compressed files for a regular expression",
        "synopsis": "zgrep [ grepoptions ] [ -e ] pattern filename...",
        "tldr_summary": "Grep text patterns from files within compressed files.",
        "tldr_examples": [
            {
                "description": "Grep a pattern in a compressed file (case-sensitive)",
                "command": "zgrep {{pattern}} {{path/to/compressed_file}}"
            },
            {
                "description": "Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match",
                "command": "zgrep {{-context|--before-context|--after-context}} 3 {{pattern}} {{path/to/compressed_file}}"
            },
            {
                "description": "Grep a pattern in a compressed file (case-insensitive)",
                "command": "zgrep {{-i|--ignore-case}} {{pattern}} {{path/to/compressed_file}}"
            },
            {
                "description": "Output count of lines containing matched pattern in a compressed file",
                "command": "zgrep {{-c|--count}} {{pattern}} {{path/to/compressed_file}}"
            },
            {
                "description": "Display the lines which don't have the pattern present (Invert the search function)",
                "command": "zgrep {{-v|--invert-match}} {{pattern}} {{path/to/compressed_file}}"
            },
            {
                "description": "Grep a compressed file for multiple patterns",
                "command": "zgrep {{-e|--regexp}} \"{{pattern_1}}\" {{-e|--regexp}} \"{{pattern_2}}\" {{path/to/compressed_file}}"
            },
            {
                "description": "Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`)",
                "command": "zgrep {{-E|--extended-regexp}} {{regex}} {{path/to/file}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "grep",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/grep/1/json"
            },
            {
                "name": "gzexe",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gzexe/1/json"
            },
            {
                "name": "gzip",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gzip/1/json"
            },
            {
                "name": "zdiff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zdiff/1/json"
            },
            {
                "name": "zforce",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zforce/1/json"
            },
            {
                "name": "zmore",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zmore/1/json"
            },
            {
                "name": "znew",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/znew/1/json"
            },
            {
                "name": "ZGREP",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ZGREP/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "zgrep - search possibly compressed files for a regular expression\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "zgrep [ grepoptions ] [ -e ] pattern filename...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  zgrep  command  invokes  grep on compressed or gzipped files.  All options specified are\npassed directly to grep.  If no file is specified, then the standard input is decompressed if\nnecessary and fed to grep.  Otherwise the given files are uncompressed if necessary  and  fed\nto grep.\n\nIf the GREP environment variable is set, zgrep uses it as the grep program to be invoked.\n",
                "subsections": []
            },
            "EXIT STATUS": {
                "content": "Exit status is 0 for a match, 1 for no matches, and 2 if trouble.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "The  following  grep  options  are not supported: --dereference-recursive (-R), --directories\n(-d), --exclude, --exclude-from, --exclude-dir, --include, --null (-Z), --null-data (-z), and\n--recursive (-r).\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Charles Levert (charles@comm.polymtl.ca)\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)\n\nZGREP(1)",
                "subsections": []
            }
        }
    }
}