TOUCH(1) | General Commands Manual | TOUCH(1) |
touch
—
touch |
[-acfhm ] [-d
human-datetime]
[- -date
human-datetime] [-r
file]
[- -reference
file] [-t
datetime] file ... |
touch
utility changes the access and modification
times of files to the current time of day. If the file doesn't exist, it is
created with default permissions.
The following options are available:
-a
-m
flag is also
specified.-c
touch
utility does not treat this as an error. No
error messages are displayed and the exit value is not affected.-d
human-datetime-
-date
human-datetime-f
-h
-c
.-m
-a
flag is also
specified.-r
file-
-reference
file-t
datetimeTZ
environment variable, does not refer to
a leap second, the resulting time is one second after a time where
SS is 59. If SS is not
given a value, it is assumed to be zero.If the “CC” and “YY” letter pairs are not specified, the values default to the current year. If the “SS” letter pair is not specified, the value defaults to 0.
The -d
, -r
, and
-t
options are mutually exclusive. If more than one
of these options is present, the last one is used.
TZ
-t
option.touch
utility exits 0 on success,
and >0 if an error occurs.
touch
, where a time format is
specified as the first argument, is supported. When no
-d
, -r
, or
-t
option is specified, there are at least two
arguments, and the first argument is a string of digits either eight or ten
characters in length, the first argument is interpreted as a time
specification of the form “MMDDhhmm[YY]”.
The “MM”, “DD”, “hh” and
“mm” letter pairs are treated as their counterparts specified
to the -t
option. If the “YY” letter
pair is in the range 69 to 99, the year is set to 1969 to 1999, otherwise,
the year is set in the 21st century.
touch
utility is expected to be a superset of the
IEEE Std 1003.2 (“POSIX.2”)
specification.
touch
utility appeared in
Version 7 AT&T UNIX.
December 24, 2016 | NetBSD 9.4 |