What does command | tee output.log do?
Shell Pipes and Output Redirection Online Quiz Questions
Use this free practice quiz with 20 questions to review Shell Pipes and Output Redirection, test your knowledge, and prepare for your next test or exam.
Select all statements that correctly describe these shell redirections.
- A
command > fileappends standard output to the file. - B
command >> fileappends standard output to the file. - C
command 2> filewrites standard error to the file, replacing its previous contents. - D
command > all.log 2>&1sends both standard output and standard error toall.log. - E
command 2>&1 > all.logsends both standard output and standard error toall.log.
A regular pipe (|) passes both standard output and standard error from one command to the next.
- A
True
- B
False
In command | tee OPTION output.log, what option makes tee append to output.log instead of replacing it?
To append a command’s standard output to a file, use command file.
Explain how a regular shell pipe connects two commands and what happens to standard error. Briefly note how the Bash operator |& differs.
Which statement correctly describes command | tee -a output.log?
- A
tee output.logappends to the file and suppresses terminal output. - B
tee -a output.logredirects standard error to the file. - C
tee -a output.logappends to the file while continuing to copy input to standard output. - D
tee -a output.logreplaces the file and sends no output to standard output.
Select all statements that correctly describe a regular pipe (|).
- A
It sends one command’s standard output to the next command’s standard input.
- B
It does not pass standard error unless that stream is explicitly merged or redirected.
- C
It allows commands to work in stages without first saving intermediate results to a file.
- D
It sends standard error to the next command but leaves standard output in the terminal.
The command command 2>&1 > all.log sends both standard output and standard error to all.log.
- A
True
- B
False
What file descriptor number represents standard error in a typical Unix-like shell?
To append a command’s standard output to results.log without replacing its existing contents, use command results.log.
What does command | tee output.log do?
- A
It sends standard error to a file while leaving standard output unchanged.
- B
It copies its standard input to standard output and to a named file.
- C
It appends standard output to a file without displaying it.
- D
It sends standard input directly to a file and suppresses standard output.
In command 2>&1 > all.log, both standard output and standard error are redirected to all.log.
- A
True
- B
False
Which shell redirection operator sends a command’s standard error to a file?
Which stream does a regular shell pipe (|) pass from one command to the next?
- A
It passes standard error, but not standard output.
- B
It passes both standard output and standard error.
- C
It passes standard output, but not standard error.
- D
It passes standard input directly to the next command’s standard output.
In command > all.log 2>&1, standard output is sent to all.log first, and standard error is then sent to the same destination.
- A
True
- B
False
Which shell operator redirects standard output to a file, replacing that file’s previous contents if it exists?
What connection does the pipe in first_command | next_command create?
- A
It sends the first command’s standard output to the next command’s standard input.
- B
It sends the first command’s standard error to the next command’s standard input.
- C
It sends the next command’s standard output to the first command’s standard input.
- D
It saves the first command’s output to a file before the next command runs.
In which direction does the shell process redirections in a command?
What does command > out.log 2> errors.log do?
- A
It writes standard output and standard error together to
out.log. - B
It appends standard output to
out.logand leaves standard error unchanged. - C
It writes standard error to
out.logand standard output toerrors.log. - D
It writes standard output to
out.logand standard error toerrors.log.
Related study packs and tools
3 Airway, Respiration, and Ventilation
Review EMT airway assessment, breathing mechanics, airway management, ventilation support, and priorities for common respiratory emergencies.
3 Airway, Respiration, and Ventilation
Learn how to assess airway and breathing, distinguish ventilation from oxygenation and respiration, provide appropriate support, and recognize common respiratory emergencies.
4 Cardiology and Resuscitation
Review cardiac assessment and emergencies, adult and pediatric CPR, AED use, and special resuscitation priorities for EMTs.
4 Cardiology and Resuscitation
A medium-difficulty quiz on EMT cardiovascular assessment, cardiac emergencies, CPR, AED use, and special resuscitation considerations.
4 Cardiology and Resuscitation
Learn how EMTs assess cardiac emergencies, recognize poor perfusion, and provide prompt care for cardiac arrest and other resuscitation situations.
6 Medical Emergencies
Review EMT priorities and key recognition and care principles for neurologic, metabolic, respiratory, toxicologic, behavioral, and environmental emergencies.
6 Medical Emergencies
A medium-difficulty quiz on recognizing and responding to medical emergencies within EMT scope and local protocols.
6 Medical Emergencies
Learn how EMTs approach medical emergencies, recognize time-sensitive conditions, provide care within their scope and local protocols, and arrange appropriate transport.
7 Obstetrics, Gynecology, and Pediatric Emergencies
A medium-difficulty quiz on practical assessment, treatment, and transport decisions in obstetric, gynecologic, neonatal, and pediatric emergencies.
8 EMS Operations
A medium-difficulty quiz on applying EMT operational principles to scene safety, communication, incident management, patient rights, and coordinated care.
9 Comprehensive EMT Practice Scenarios and Review
Review EMT exam domains and the priorities, interventions, and responsibilities that guide safe care in common emergency scenarios.
9 Comprehensive EMT Practice Scenarios and Review
Practice applying EMT scene safety, assessment, intervention, transport, and operational principles to realistic situations.