{
    "mode": "man",
    "parameter": "tee",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/tee/1/json",
    "generated": "2026-06-02T21:26:00Z",
    "synopsis": "tee [OPTION]... [FILE]...",
    "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\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"
                }
            ]
        },
        "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  ©  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",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Full 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)",
            "subsections": []
        }
    },
    "summary": "tee - read from standard input and write to standard output and files",
    "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": [],
    "tldr": {
        "source": "official",
        "description": "Read from `stdin` and write to `stdout` and files (or commands).",
        "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}})"
            }
        ]
    }
}