LPI
117-010 · Question #34
How can the normal output of a command be written to a file while discarding the error output?
The correct answer is E. command >file 2>/dev/null. See the full explanation below for the reasoning.
Question
How can the normal output of a command be written to a file while discarding the error output?
Options
- Acommand >2>file 1&>/dev/null
- Bcommand < output > /dev/null
- Ccommand > discard-error > file
- Dcommand > /dev/null 2&>1 output
- Ecommand >file 2>/dev/null
How the community answered
(27 responses)- A11% (3)
- B7% (2)
- C4% (1)
- D4% (1)
- E74% (20)
Community Discussion
No community discussion yet for this question.