U.S. Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation LFCS Exam - Topic 1 Question 113 Discussion

Which of the following commands redirects the output of cmd to the file foo.txt, in which an existing file is overwritten?
E) cmd > foo.txt
A) cmd || foo.txt
B) cmd | foo.txt
C) cmd && foo.txt
D) cmd >> foo.txt

Linux Foundation LFCS Exam - Topic 1 Question 113 Discussion

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

Which of the following commands redirects the output of cmd to the file foo.txt, in which an existing file is overwritten?

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

0/2000 characters
Jolanda
1 month ago
I keep mixing up the symbols! I know ">>" appends, but I can't recall if ">" is the one that overwrites.
upvoted 0 times
...
Linwood
2 months ago
I remember practicing with output redirection, and I feel like "cmd > foo.txt" is the right choice for overwriting.
upvoted 0 times
...
King
2 months ago
I think the command that overwrites the file is the one with a single greater than sign, but I'm not completely sure.
upvoted 0 times
...

Save Cancel