Which command is used to modify the access time of a file?
-
chmod
-
touch
-
chown
-
mtime
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.
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.