Forrest logo
back to the echo tool

tee:tldr:ff914

tee: Copy standard input to each file, and also to standard output.
$ echo "example" | tee ${filename}
try on your machine

The command echo "example" | tee ${filename} is a combination of two commands in Linux: echo and tee.

  1. echo "example" is a command used to print the string "example" on the console.

  2. | is a pipe symbol that redirects the output of the previous command (echo) to the input of the next command (tee).

  3. tee is a command that reads the input from the pipe and both displays it on the console and writes it to a file.

  4. ${filename} is a placeholder for the actual name of the file. It should be replaced with the desired filename, including the path if necessary.

Therefore, when you execute this command, it will print "example" on the console and write it to the file specified by ${filename}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the echo tool