Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam LFCS topic 1 question 50 discussion

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

Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log?

  • A. cat < myapp | cat > file1.log
  • B. myapp 0>&1 | cat > file1.log
  • C. myapp | cat > file1.log
  • D. myapp | tee file1.log
  • E. tee myapp file1.log
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Buruguduystunstugudunstuy
1 year, 3 months ago
Selected Answer: D
The command that will send output from the program 'myapp' to both standard output (stdout) and the file 'file1.log' is 'myapp | tee file1.log'. Option D is the correct answer. The 'tee' command is used to redirect output from a command to multiple places, including stdout and a file. It takes the output from the command on its standard input and writes it to both stdout and the specified file. To send output from the program 'myapp' to both stdout and the file 'file1.log', you can use the following command: myapp | tee file1.log This command will execute the program 'myapp' and redirect its output to the 'tee' command. The 'tee' command will write the output to both stdout and the file 'file1.log'.
upvoted 1 times
Buruguduystunstugudunstuy
1 year, 3 months ago
The other options do not accurately describe the behavior of the 'tee' command: Option A: The 'cat < myapp | cat > file1.log' command will not send the output from the program 'myapp' to both stdout and the file 'file1.log'. It will only send the output to the file 'file1.log'. Option B: The 'myapp 0>&1 | cat > file1.log' command is not a valid command. Option C: The 'myapp | cat > file1.log' is incorrect because it will only send the output from the program 'myapp' to the file 'file1.log'. It will not send the output to stdout.
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 ...