8.1 Working With Files
Syntax
touch [options] [date_time] file
touch [options] [-t time] file
Common Options
-a change the access time of the file (SVR4 only)
-c don't create the file if it doesn't already exist
-f force the touch, regardless of read/write permissions
-m change the modification time of the file (SVR4 only)
-t time use the time specified, not the current time (SVR4 only)
When setting the "-t time" option it should be in the form:
[[CC]YY]MMDDhhmm[.SS]
where:
CC first two digits of the year
YY second two digits of the year
MM month, 01-12
DD day of month, 01-31
hh hour of day, 00-23
mm minute, 00-59
SS second, 00-61
The date_time options has the form:
MMDDhhmm[YY]
where these have the same meanings as above.
The date cannot be set to be before 1969 or after January 18, 2038.
Examples
To create a file:
% touch filename