tee(1)

tee1

Duplicate standard input

Usage

tee [-ai] [file ...]

Overview

The tee utility copies standard input to standard output, making a copy in zero or more files. The output is unbuffered.

The following options are available:

-a

Append the output to the files rather than overwriting them.

-i

Ignore the SIGINT signal.

The following operands are available:

file

A pathname of an output file.

The tee utility takes the default action for all signals, except in the event of the -i option.

This implementation of the tee utility may also write to unix(4) sockets.

Exit status

The tee utility exits 0 on success, and >0 if an error occurs.

Examples

Send the echoed message both to stdout and to the greetings.txt file:

$ echo "Hello" | tee greetings.txt
Hello

Releases

87 releases since FreeBSD 2.0.5-RELEASE; the text changed 41 times.

  1. 2.0.5–2.2.2
  2. 2.2.5–3.5.1
  3. 4.0
  4. 4.1–4.3
  5. 4.4–4.11
  6. 5.0–5.5
  7. 6.0–6.3
  8. 6.4
  9. 7.0
  10. 7.1
  11. 7.2
  12. 7.3
  13. 7.4
  14. 8.0
  15. 8.1
  16. 8.2
  17. 8.3
  18. 8.4
  19. 9.0
  20. 9.1
  21. 9.2
  22. 9.3
  23. 10.0
  24. 10.1
  25. 10.2
  26. 10.3
  27. 10.4
  28. 11.0
  29. 11.1
  30. 11.2
  31. 11.3
  32. 11.4
  33. 12.0
  34. 12.1
  35. 12.2
  36. 12.3
  37. 12.4
  38. 13.0–13.1
  39. 13.2
  40. 13.3–14.2
  41. 14.3–14.5
  42. 15.0–16.0

Standards

The tee utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.

History

The tee command first appeared in Version 7 AT&T UNIX.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.