Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (t - u) touch(1)
NAME
touch - Updates file access and modification times
SYNOPSIS
Current Syntax
touch [-acfm][-r reference_file | -t time] file ...
Obsolescent Syntax
touch [-acfm][time] file ...
The touch command updates the access and modification times of each file or directory named to
the time specified on the command line.
Do not use the touch command on files in the Guardian environment.
FLAGS
-a Changes only the access time.
-c Suppresses the creation of the file without any diagnostic messages.
-f Attempts to force the touch in spite of read and write permissions on a file. -f is actu-
ally a dummy flag; it is not used by the touch code, but is recognized by getopt().
-m Changes only the modification time.
-r reference_file
Uses the time of the file named by the pathname reference_file instead of the current
time.
-t time Uses the specified time instead of the current time. The time argument is a decimal
number in the following form:
[[CC]YY]MMDDhhmm[.SS]
The paired decimal numbers in the preceding syntax line represent the following:
CC The first two digits of the year (the century).
YY The second two digits of the year (00-99).
MM The month of the year (01-12).
DD The day of the month (01-31).
hh The hour of the day (00-23).
mm The minute of the hour (00-59).
SS The second of the minute (00-61).
Both CC and YY are optional. If neither is specified, the current year is assumed. If YY
is specified, but CC is not, CC is derived as follows:
• If YY is 69-99, CC is 19.
• If YY is 00-68, CC is 20.
The resulting time is affected by the value of the TZ environment variable. If the
resulting time value precedes the Epoch, touch exits immediately with an error status.
The range of valid times past the Epoch extends to at least midnight 1 January 2000
UT.
527188-003 Hewlett-Packard Company 9−15