change file access and modification times
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 .
| Do not create the file if it does not exist and do not treat this as an error.
| Attempt to force the update, even if the file permissions do not currently permit it.
| Use the times of |
| Change the modification time only
|Change the access time only
| Change the access and modification times.
| century,first two digits of the year
| second two digits of the year. Default: current year
CC is omitted, a value for
YY between 69 and 99 results in
CC value of 19.
CC value of 20 is used.
defaults to 0.
|affect each symbolic link instead of any referenced
file (useful only on systems that can change the
timestamps of a symlink)
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
0 on success
1 permission denied, unknown flag, invalid date format .
touch [-acfm] [[MMDDhhmm[YY]]
† file …
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:
omitting the year can cause times to be set to the future (for example
|For example without |
|instead of the correct |
|results in the unpredictable (by the author) |
touch 12312359 futureFile.txt).
BSD April 28, 1995