Question 220
A technician working on a classroom Linux system finds: An instructor asks students to rename draft.md to final.md but a student uses rm followed by touch, losing the contents. Which check should be added to the learning checklist?
Explanation
Correct Answer
Use move or rename operations instead of delete-and-recreate for existing content. This practice reduces recurrence of the same problem. Technical reason: The mv operation changes a filesystem entry's name or location rather than replacing the file with an empty one. A controlled repeat test should show: The new filename contains the original draft text and the old pathname no longer exists.
Incorrect Answers
This option would change the part of the system described by: Check whether the target directory exists before teaching move semantics. The reported behavior instead arises because use move or rename operations instead of delete-and-recreate for existing content. The direct remediation is “Use move or rename operations instead of delete-and-recreate for existing content”.
The proposed action focuses on a control governed by: Teach touch behavior on existing files so timestamp updates are not mistaken for data changes. In this question the binding condition is: Use move or rename operations instead of delete-and-recreate for existing content. Applying “Use move or rename operations instead of delete-and-recreate for existing content” addresses that specific cause instead.
“Use -p deliberately when a procedure is intended to be repeatable” acts on a neighboring technical dependency: Use -p deliberately when a procedure is intended to be repeatable. It does not resolve the stated condition, whose causal mechanism is: Use move or rename operations instead of delete-and-recreate for existing content. The required action is “Use move or rename operations instead of delete-and-recreate for existing content”.