nerdexam
Linux_Foundation

LFCS · Question #793

For which of the following can the tee command be used?

The correct answer is E. Send a command's output to stdout and a to file at the same time. The tee command is used to duplicate a command's standard output, sending it simultaneously to both the screen and one or more specified files.

Submitted by neha2k· Apr 18, 2026Essential Commands

Question

For which of the following can the tee command be used?

Options

  • APrint the contents of a file in reverse order.
  • BUse the output of one command as arguments to another.
  • CAdd line numbers to the output of a command.
  • DPipe the output of one command into the input of another.
  • ESend a command's output to stdout and a to file at the same time.

How the community answered

(41 responses)
  • A
    5% (2)
  • B
    2% (1)
  • C
    5% (2)
  • E
    88% (36)

Why each option

The `tee` command is used to duplicate a command's standard output, sending it simultaneously to both the screen and one or more specified files.

APrint the contents of a file in reverse order.

The `tee` command does not have functionality to reverse the order of file contents; commands like `tac` or `rev` are used for that.

BUse the output of one command as arguments to another.

Using command output as arguments for another command is typically achieved with backticks or `$(...)`, not the `tee` command.

CAdd line numbers to the output of a command.

Adding line numbers to command output is usually done with commands like `nl` or `cat -n`.

DPipe the output of one command into the input of another.

Piping the output of one command into the input of another is the general function of the `|` (pipe) operator, not specifically the `tee` command itself.

ESend a command's output to stdout and a to file at the same time.Correct

The `tee` command reads standard input and writes it to standard output (typically the screen) while also redirecting a copy of that same output to a file or multiple files, acting like a T-junction for data streams.

Concept tested: tee command functionality

Source: https://www.gnu.org/software/coreutils/manual/html_node/tee-invocation.html

Topics

#tee command#I/O redirection#stdout#file output

Community Discussion

No community discussion yet for this question.

Full LFCS Practice