{
    "content": [
        {
            "type": "text",
            "text": "# tee(1) (man)\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---\n\n**Summary:** tee - read from standard input and write to standard output and files\n\n**Synopsis:** tee [OPTION]... [FILE]...\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | --append | — | append to the given FILEs, do not overwrite |\n| -i | --ignore-interrupts | — | ignore interrupt signals |\n| -p | — | — | --output-error[=MODE] set behavior on write error. See MODE below --help display this help and exit |\n| — | --version | — | output version information and exit |\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (2 lines) — 5 subsections\n  - -a --append (2 lines)\n  - -i --ignore-interrupts (2 lines)\n  - -p (5 lines)\n  - --version (2 lines)\n  - MODE determines behavior with write errors on the outputs: (14 lines)\n- **AUTHOR** (2 lines)\n- **REPORTING BUGS** (3 lines)\n- **COPYRIGHT** (5 lines)\n- **SEE ALSO** (6 lines)\n\n## Full Content\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#### -a --append\n\nappend to the given FILEs, do not overwrite\n\n#### -i --ignore-interrupts\n\nignore interrupt signals\n\n#### -p\n\n--output-error[=MODE]\nset behavior on write error.  See MODE below\n\n--help display this help and exit\n\n#### --version\n\noutput version information and exit\n\n#### MODE determines behavior with write errors on the outputs:\n\n'warn' diagnose errors writing to any output\n\n'warn-nopipe'\ndiagnose errors writing to any output not a pipe\n\n'exit' exit on error writing to any output\n\n'exit-nopipe'\nexit on error writing to any output not a pipe\n\nThe default MODE for the -p option is 'warn-nopipe'.  The default operation when --output-er‐‐\nror is not specified, is to exit immediately on error writing to a pipe, and diagnose  errors\nwriting to non pipe outputs.\n\n### AUTHOR\n\nWritten by Mike Parker, Richard M. Stallman, and David MacKenzie.\n\n### REPORTING BUGS\n\nGNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n\n### COPYRIGHT\n\nCopyright  ©  2020 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\n### SEE ALSO\n\nFull documentation <https://www.gnu.org/software/coreutils/tee>\nor available locally via: info '(coreutils) tee invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                      TEE(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "tee",
        "section": "1",
        "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": 14
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}