exam questions

Exam LFCS All Questions

View all questions & answers for the LFCS exam

Exam LFCS topic 1 question 72 discussion

Actual exam question from Linux Foundation's LFCS
Question #: 72
Topic #: 1
[All LFCS Questions]

Which of the following shell redirections will write 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
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
9866666
5 months, 1 week ago
Selected Answer: B
The correct answer is B. >filename 2>&1
upvoted 1 times
...
Strib
1 year, 5 months ago
Selected Answer: B
The correct option is: B. Explanation: To write both standard output (stdout) and standard error output (stderr) to a file named "filename," you need to redirect both streams appropriately. By combining these redirections, both stdout and stderr will be written to the file named "filename." Any errors or regular output generated by the command will be captured in the same file.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...