Multiple choice technology operating systems

Which command is used to modify the access time of a file?

  1. chmod

  2. touch

  3. chown

  4. mtime

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

The touch command updates both access and modification times of a file (creates file if it doesn't exist). chmod changes permissions, chown changes ownership, and mtime is not a valid command.

AI explanation

The touch command updates a file's timestamps — by default both access time (atime) and modification time (mtime) to the current time — and can create an empty file if it doesn't exist. Flags like -a (access time only) or -m (modification time only) let you target one specifically. chmod changes permissions, not timestamps; chown changes file ownership; 'mtime' is not a command at all — it's a find predicate (-mtime) used to search by modification age, not a way to modify a timestamp. So touch is the correct command.