Multiple choice

Which of the following commands is used to update 'access & modification times' of a file?

  1. grep

  2. wc

  3. touch

  4. cat

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The touch command in UNIX is specifically designed to update the access and modification timestamps of a file. If the file doesn't exist, touch creates it with current timestamps. This is useful for tracking when files were last accessed or modified.