{
    "content": [
        {
            "type": "text",
            "text": "# tee (man)\n\n## NAME\n\ntee - read from standard input and write to standard output and files\n\n## SYNOPSIS\n\ntee [OPTION]... [FILE]...\n\n## DESCRIPTION\n\nCopy standard input to each FILE, and also to standard output.\n\n## TLDR\n\n> Read from `stdin` and write to `stdout` and files (or commands).\n\n- Copy `stdin` to each file, and also to `stdout`:\n  `echo \"example\" | tee {{path/to/file}}`\n- Append to the given files, do not overwrite:\n  `echo \"example\" | tee {{-a|--append}} {{path/to/file}}`\n- Print `stdin` to the terminal, and also pipe it into another program for further processing:\n  `echo \"example\" | tee {{/dev/tty}} | {{xargs printf \"[%s]\"}}`\n- Create a directory called \"example\", count the number of characters in \"example\", and write \"example\" to the terminal:\n  `echo \"example\" | tee >(xargs mkdir) >(wc {{-c|--bytes}})`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (5 subsections)\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "tee",
        "section": "",
        "mode": "man",
        "summary": "tee - read from standard input and write to standard output and files",
        "synopsis": "tee [OPTION]... [FILE]...",
        "tldr_summary": "Read from `stdin` and write to `stdout` and files (or commands).",
        "tldr_examples": [
            {
                "description": "Copy `stdin` to each file, and also to `stdout`",
                "command": "echo \"example\" | tee {{path/to/file}}"
            },
            {
                "description": "Append to the given files, do not overwrite",
                "command": "echo \"example\" | tee {{-a|--append}} {{path/to/file}}"
            },
            {
                "description": "Print `stdin` to the terminal, and also pipe it into another program for further processing",
                "command": "echo \"example\" | tee {{/dev/tty}} | {{xargs printf \"[%s]\"}}"
            },
            {
                "description": "Create a directory called \"example\", count the number of characters in \"example\", and write \"example\" to the terminal",
                "command": "echo \"example\" | tee >(xargs mkdir) >(wc {{-c|--bytes}})"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": "--append",
                "arg": null,
                "description": "append to the given FILEs, do not overwrite"
            },
            {
                "flag": "-i",
                "long": "--ignore-interrupts",
                "arg": null,
                "description": "ignore interrupt signals"
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "--output-error[=MODE] set behavior on write error. See MODE below --help display this help and exit"
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "output version information and exit"
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-a --append",
                        "lines": 2,
                        "flag": "-a",
                        "long": "--append"
                    },
                    {
                        "name": "-i --ignore-interrupts",
                        "lines": 2,
                        "flag": "-i",
                        "long": "--ignore-interrupts"
                    },
                    {
                        "name": "-p",
                        "lines": 5,
                        "flag": "-p"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    },
                    {
                        "name": "MODE determines behavior with write errors on the outputs:",
                        "lines": 15
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "tee - read from standard input and write to standard output and files\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "tee [OPTION]... [FILE]...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Copy standard input to each FILE, and also to standard output.\n",
                "subsections": [
                    {
                        "name": "-a --append",
                        "content": "append to the given FILEs, do not overwrite\n",
                        "flag": "-a",
                        "long": "--append"
                    },
                    {
                        "name": "-i --ignore-interrupts",
                        "content": "ignore interrupt signals\n",
                        "flag": "-i",
                        "long": "--ignore-interrupts"
                    },
                    {
                        "name": "-p",
                        "content": "--output-error[=MODE]\nset behavior on write error.  See MODE below\n\n--help display this help and exit\n",
                        "flag": "-p"
                    },
                    {
                        "name": "--version",
                        "content": "output version information and exit\n",
                        "long": "--version"
                    },
                    {
                        "name": "MODE determines behavior with write errors on the outputs:",
                        "content": "warn   diagnose errors writing to any output\n\nwarn-nopipe\ndiagnose errors writing to any output not a pipe\n\nexit   exit on error writing to any output\n\nexit-nopipe\nexit on error writing to any output not a pipe\n\nThe  default  MODE for the -p option is 'warn-nopipe'.  With \"nopipe\" MODEs, exit immediately\nif all outputs become broken pipes.  The default operation when --output-error is not  speci‐\nfied,  is  to exit immediately on error writing to a pipe, and diagnose errors writing to non\npipe outputs.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Written by Mike Parker, Richard M. Stallman, and David MacKenzie.\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright © 2023 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Full documentation <https://www.gnu.org/software/coreutils/tee>\nor available locally via: info '(coreutils) tee invocation'\n\nGNU coreutils 9.4                           January 2026                                      TEE(1)",
                "subsections": []
            }
        }
    }
}