{
    "content": [
        {
            "type": "text",
            "text": "# look (man)\n\n## NAME\n\nlook - display lines beginning with a given string\n\n## SYNOPSIS\n\nlook [options] string [file]\n\n## DESCRIPTION\n\nThe look utility displays any lines in file which contain string. As look performs a binary\nsearch, the lines in file must be sorted (where sort(1) was given the same options -d and/or\n\n## TLDR\n\n> Display lines beginning with a prefix in a sorted file.\n\n- Search for lines beginning with a specific prefix in a specific file:\n  `look {{prefix}} {{path/to/file}}`\n- Case-insensitively search only on alphanumeric characters:\n  `look {{-f|--ignore-case}} {{-d|--alphanum}} {{prefix}} {{path/to/file}}`\n- Specify a string termination character (space by default):\n  `look {{-t|--terminate}} {{,}}`\n- Search in `/usr/share/dict/words` (`--alphanum` and `--ignore-case` are assumed):\n  `look {{prefix}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **OPTIONS** (6 subsections)\n- **ENVIRONMENT**\n- **FILES**\n- **HISTORY**\n- **EXAMPLES**\n- **SEE ALSO**\n- **REPORTING BUGS**\n- **AVAILABILITY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "look",
        "section": "",
        "mode": "man",
        "summary": "look - display lines beginning with a given string",
        "synopsis": "look [options] string [file]",
        "tldr_summary": "Display lines beginning with a prefix in a sorted file.",
        "tldr_examples": [
            {
                "description": "Search for lines beginning with a specific prefix in a specific file",
                "command": "look {{prefix}} {{path/to/file}}"
            },
            {
                "description": "Case-insensitively search only on alphanumeric characters",
                "command": "look {{-f|--ignore-case}} {{-d|--alphanum}} {{prefix}} {{path/to/file}}"
            },
            {
                "description": "Specify a string termination character (space by default)",
                "command": "look {{-t|--terminate}} {{,}}"
            },
            {
                "description": "Search in `/usr/share/dict/words` (`--alphanum` and `--ignore-case` are assumed)",
                "command": "look {{prefix}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": "--alternative",
                "arg": null,
                "description": "Use the alternative dictionary file."
            },
            {
                "flag": "-d",
                "long": "--alphanum",
                "arg": null,
                "description": "Use normal dictionary character set and order, i.e., only blanks and alphanumeric characters are compared. This is on by default if no file is specified. Note that blanks have been added to dictionary character set for compatibility with sort -d command since version 2.28."
            },
            {
                "flag": "-f",
                "long": "--ignore-case",
                "arg": null,
                "description": "Ignore the case of alphabetic characters. This is on by default if no file is specified."
            },
            {
                "flag": "-t",
                "long": "--terminate",
                "arg": null,
                "description": "Specify a string termination character, i.e., only the characters in string up to and including the first occurrence of character are compared."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit. The look utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred."
            }
        ],
        "examples": [
            "sort -d /etc/passwd -o /tmp/look.dict",
            "look -t: root:foobar /tmp/look.dict"
        ],
        "see_also": [
            {
                "name": "grep",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/grep/1/json"
            },
            {
                "name": "sort",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/sort/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-f",
                        "lines": 3,
                        "flag": "-f"
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a --alternative",
                        "lines": 2,
                        "flag": "-a",
                        "long": "--alternative"
                    },
                    {
                        "name": "-d --alphanum",
                        "lines": 6,
                        "flag": "-d",
                        "long": "--alphanum"
                    },
                    {
                        "name": "-f --ignore-case",
                        "lines": 2,
                        "flag": "-f",
                        "long": "--ignore-case"
                    },
                    {
                        "name": "-t --terminate",
                        "lines": 3,
                        "flag": "-t",
                        "long": "--terminate"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 5,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "ENVIRONMENT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "look - display lines beginning with a given string\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "look [options] string [file]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The look utility displays any lines in file which contain string. As look performs a binary\nsearch, the lines in file must be sorted (where sort(1) was given the same options -d and/or",
                "subsections": [
                    {
                        "name": "-f",
                        "content": "If file is not specified, the file /usr/share/dict/words is used, only alphanumeric\ncharacters are compared and the case of alphabetic characters is ignored.\n",
                        "flag": "-f"
                    }
                ]
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-a --alternative",
                        "content": "Use the alternative dictionary file.\n",
                        "flag": "-a",
                        "long": "--alternative"
                    },
                    {
                        "name": "-d --alphanum",
                        "content": "Use normal dictionary character set and order, i.e., only blanks and alphanumeric\ncharacters are compared. This is on by default if no file is specified.\n\nNote that blanks have been added to dictionary character set for compatibility with sort\n-d command since version 2.28.\n",
                        "flag": "-d",
                        "long": "--alphanum"
                    },
                    {
                        "name": "-f --ignore-case",
                        "content": "Ignore the case of alphabetic characters. This is on by default if no file is specified.\n",
                        "flag": "-f",
                        "long": "--ignore-case"
                    },
                    {
                        "name": "-t --terminate",
                        "content": "Specify a string termination character, i.e., only the characters in string up to and\nincluding the first occurrence of character are compared.\n",
                        "flag": "-t",
                        "long": "--terminate"
                    },
                    {
                        "name": "-V --version",
                        "content": "Display version information and exit.\n",
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "content": "Display help text and exit.\n\nThe look utility exits 0 if one or more lines were found and displayed, 1 if no lines were\nfound, and >1 if an error occurred.\n",
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            "ENVIRONMENT": {
                "content": "WORDLIST\nPath to a dictionary file. The environment variable has greater priority than the\ndictionary path defined in FILES segment.\n",
                "subsections": []
            },
            "FILES": {
                "content": "/usr/share/dict/words\nthe dictionary\n\n/usr/share/dict/web2\nthe alternative dictionary\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "The look utility appeared in Version 7 AT&T Unix.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "sort -d /etc/passwd -o /tmp/look.dict\nlook -t: root:foobar /tmp/look.dict\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "grep(1), sort(1)\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
                "subsections": []
            },
            "AVAILABILITY": {
                "content": "The look command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                      LOOK(1)",
                "subsections": []
            }
        }
    }
}