nerdexam
LPI

101-500 · Question #283

To prevent a command run as root from sending both standard out (stdout) and standard error (stderr) to any terminal or other file or device, which of the following strings should be appended to the…

The correct answer is C. >/dev/null 2>&1. You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

Shells and Shell Scripting

Question

To prevent a command run as root from sending both standard out (stdout) and standard error (stderr) to any terminal or other file or device, which of the following strings should be appended to the command?

Options

  • A
    /dev/null
  • B
    /dev/null 1>&2
  • C
    /dev/null 2>&1
  • D1>&2 >/dev/null
  • E2>&1 >/dev/null

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    84% (42)
  • D
    2% (1)
  • E
    8% (4)

Explanation

You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

Topics

#I/O redirection#file descriptors#stderr and stdout#shell operators

Community Discussion

No community discussion yet for this question.

Full 101-500 Practice