Linux_FoundationLinux_Foundation
LFCS · Question #862
LFCS Question #862: Real Exam Question with Answer & Explanation
Sign in or unlock LFCS to reveal the answer and full explanation for question #862. The question stem and answer options stay visible for context.
Submitted by yuriko_h· Apr 18, 2026Essential Commands
Question
When running the command sed -e "s/a/b/" /tmp/file >/tmp/file While /tmp/file contains data, why is /tmp/file empty afterwards?
Options
- AThe file order is incorrect. The destination file must be mentioned before the command to ensure
- BThe command sed did not match anything in that file therefore the output is empty.
- CWhen the shell establishes the redirection it overwrites the target file before the redirected
- DRedirection for shell commands do not work using the > character. It only works using the |
Unlock LFCS to see the answer
You've previewed enough free LFCS questions. Unlock LFCS for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#Shell Redirection#Command Execution Order#File Truncation#sed command