---
# System prepended metadata

title: ByteWise - Command `tee`
tags: [bytewise, ' linux', ' tee', ' command']

---

---
title: ByteWise - Command `tee`
tags: bytewise, tee, linux, command
---

# Command `tee`

:::warning
**Question**: The other day, I ran into a command says `echo $VALUE | sudo tee $FILE_PATH`. It makes me wonder how this differs from the `sudo echo > $FILE_PATH`.
:::

Acording to the `man`
> tee - read from standard input and write to standard output and files

## Digest

There are few benefit of using this over the other.

* I do not need to elevate the privileges for the first command.
* Using `tee` let's you split the output. I can either view it (by directing stdout to the `tty` where I am looking at) or pass it on to further processing. It is handy for keeping track of intermediate stages of a pipeline.