update access and modification times of a file
touch [ -acm ] [ -r ref_file ] [
touch [ -acm ] [
MMDDhhmm[yy] ] file ...
touch updates the access and modification times of each
file argument. touch uses the current time if
none is specified (see
touch can set the modification and access times to any
specified time when creating a new file. The inode change time,
however, is set to the current time and cannot be changed.
touch supports the following options:
If neither -a nor -m is given, touch
updates both the access and modification times (equivalent to
Update the access time only. The modification time is not changed
unless the -m option is also specified.
Silently prevent touch from creating a file if it does not
Update the modification time only. The access time is not changed
unless the -a option is also specified.
Use the access and modification times of the file ref_file
instead of the current time.
Use the specified time instead of the current time. The form of
the specified time is
first two digits of the year (the century minus one) [19-20];
last two digits of the year [00-99]
second [00-61]; the values 60 and 61 are used for leap seconds
If neither -r nor -t is specified, there are two
or more arguments, and the first argument is an eight or ten-digit
number, touch interprets the number as the access and
modification time. Otherwise, touch assumes the argument
is a filename to be touched.
The time format is MMDDhhmm[yy];
yy is a year number in the range 69-99 corresponding to
1969-1999. The other components of the time have the same meaning as
their -t counterparts
touch returns the number of files for which the times
could not be successfully modified (including files that did not
exist and were not created).
touch .c sets the access and modifications times of
all the C-source files in the present working directory to
the current time. This causes all the target files which depend on
these files to be remade if
is subsequently invoked.
touch andgo sets the access and modification time on the
file andgo to the current time, as does touch -am
touch -a -t 199201010000.00 andgo sets only the access
time on andgo to the beginning of 1992.
touch is conformant with:
ISO/IEC DIS 99452:1992, Information technology Portable Operating System Interface (POSIX) Part 2: Shell and Utilities (IEEE Std 1003.21992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.
A version of touch
that can handle files greater than 2GB
is available in /u95/bin. See
for more information.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005