nerdexam
LPI

010-160 · Question #57

Why is the file data.txt empty after executing sort data.txt > data.txt?

Sign in or unlock 010-160 to reveal the answer and full explanation for question #57. The question stem and answer options stay visible for context.

The Power of the Command Line

Question

Why is the file data.txt empty after executing sort data.txt > data.txt?

Options

  • ABecause, if data.txt is empty now, it must have been empty before.
  • BBecause sort cannot sort text files, only binary files.
  • CBecause sort detects that both files are the same.
  • DBecause the file gets truncated before sort is executed.
  • EBecause the file is locked and cannot be written to.

Unlock 010-160 to see the answer

You've previewed enough free 010-160 questions. Unlock 010-160 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#output redirection#file truncation#sort command
Full 010-160 Practice