Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
For one or more files, update the access time and modification time (and dates) to the current time and date. touch is useful in forcing other commands to handle files a certain way; for example, the operation of make, and sometimes find, relies on a file's access and modification time. If a file doesn't exist, touch creates it with a file size of 0.
Options
-a, --time=atime, --time=access, --time=use
Update only the access time.
-c, --no-create
Do not create any file that doesn't already exist.
-dtime, --datetime
Change the time value to the specified time instead of the current time. time can use several formats and may contain month names, time zones, a.m. and p.m. strings, etc.
-m, --time=mtime, --time=modify
Update only the modification time.
-rfile, --referencefile
Change times to be the same as those of the specified file, instead of the current time.
-ttime
Use the time specified in time instead of the current time. This argument must be of the format [[cc] yy] mmddhhmm[.ss] , indicating optional century and year, month, date, hours, minutes, and optional seconds.