touch

change file access and modification times

touch [-acfm] [[MMDDhhmm[YY]] file

touch [-acfm] [-r referenceFile] [-t [[CC]YY]MMDDhhmm[.ss]] file

Sets the modification and access times of files
If the file doesn't exist, it is created .

Default now, omitting the year can cause times to be set to the future (for example touch 12312359 futureFile.txt).

Alphabetic characters in the time cause the time to be treated as a file which will be created and file wil be updated with now!.

Illegal decimal values:

For example without -t 1801022359
yymmddhhmm
instead of the correct 0102235918
mmddhhmmyy
results in the unpredictable (by the author) 06/01/60 02:23:55

-m Change the modification time only
-a Change the access time only
-c Do not create the file if it does not exist and do not treat this as an error.
-f Attempt to force the update, even if the file permissions do not currently permit it.
-r Use the times of referenceFile
-t Change the access and modification times. [[CC]YY]MMDDhhmm[.ss]
CC century,first two digits of the year
YY second two digits of the year. Default: current year If CC is omitted, a value for YY between 69 and 99 results in a CC value of 19.
Otherwise, a CC value of 20 is used.
MM 1-12 DD 1-31
hh 0-23; mm 0-59; ss 0-61 defaults to 0.

Time may be specified as the first argument. If YY is in the range 39 to 99, CC is set to 19, otherwise, CC is set to 20
Notice that this is different from the start year with -t

The touch utility exits 0 on success, and >0 if an error occurs.
1 permission denied, unknown flag.

SEE utimes BSD April 28, 1995