QuestionQ25

Essential Commands

Which of the following shell redirections writes standard output and standard error output to a file named filename?

  • A 2>&1 >filename
  • B
    filename 2>&1
  • C 1>&2>filename
  • D
    filename
  • E 1&2>filename
Explanation

>filename 2>&1 redirects standard output to filename and then duplicates that redirected output descriptor for standard error. Redirection order is significant: both file descriptors therefore point to the same file.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!