NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO | NOTES
touch is a target utility.
touch sets the modification and access times of files. If a file specified does not exist, it is created with default permissions.
touch accepts the following options:
Change the access time of the file. The modification time of the file is not changed unless the -m option is also specified.
Do not create the file if it does not exist. touch does not treat this as an error. No error messages are displayed and the exit value is not affected.
Attempt to force the update, even if the file permissions do not currently permit it.
Change the modification time of the file. The access time of the file is not changed unless the -a option is also specified.
Use the access and modification times from the specified file instead of the current time of day.
Change the access and modification times to the specified time. The argument must be of the form [[[CC]YY]MMDDhhmm[.SS]]
where each pair of letters represents the following:
First two digits of the year that represent the century.
Last two digits of the year. If YY is specified and CC is not: values of YY between 69 and 99 result in a value of 19 for CC; other values of YY result in a value of 20 for CC.
The month of the year, from 01 to 12.
The day of the month, from 01 to 31.
The hour of the day, from 01 to 24.
The minute of the hour, from 01 to 59.
The second of the minute, from 01 to 59.
touch exits with 0 if successful, and a number greater than 0 if an error occurs.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
touch supports the obsolescent form of the same command, for which a time format is specified as the first argument. When no -r or -t option is specified, there are at least two arguments, the first argument being a string of eight or ten characters, interpreteted as a time specification of the form [MMDDhhmm[YY]]
where values of YY between 39 and 99 imply the twentieth century and values between 00 and 38 imply the twenty-first century.
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO | NOTES