Difficulty: Easy
Correct Answer: -a
Explanation:
Introduction / Context:
While touch can modify both access and modification timestamps, administrators and build systems often need to control them independently. Selecting the correct switch avoids unintended changes and preserves audit trails where mtime should remain untouched.
Given Data / Assumptions:
Concept / Approach:
The -a option tells touch to change the access time only. The -m option (not listed in distractors) changes the modification time only. The -t option supplies an explicit timestamp but, by itself, affects both atime and mtime unless combined with -a or -m. Options -b and -h are unrelated here (-h affects symlink timestamps on some systems).
Step-by-Step Solution:
Verification / Alternative check:
Compare stat output before and after running 'touch -a'. You should see atime updated while mtime stays the same, proving that -a is the correct, targeted switch.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting that -t requires format YYYYMMDDhhmm[.ss], and overlooking mount options like relatime which may delay atime updates on access.
Final Answer:
-a
Discussion & Comments