TOUCH(1) | General Commands Manual | TOUCH(1) |
touch
— change
file access and modification times
touch |
[-acfhm ] [-d
datetime | -t
timestamp | -r
ref_file] file... |
touch
changes the date modification and
access times on each file it is given.
-a
-m
is also given.-c
-f
-d
datetime-h
-m
-a
is also given.-t
timestampCC
’YY
’MMDDhhmm
’.SS
’For example:
‘200306021337.42
’
-r
ref_fileMultiple different but unambiguous formats are supported: @epoch, Email, asctime, RFC3339.
Leading @ (at) symbol followed by the Unix timestamp (number of
seconds before and after 1970-01-01 00:00:00Z), for example
‘@1698791420
’ corresponds to
2023-10-31 23:30:20 UTC
Also known as "Internet Message Format" (RFC5322, RFC2822, RFC822), for example:
Fri, 21 Nov 1997 09:55:06
-0600
’21 Nov 97 09:55:06 GMT
’Output format of asctime(3), for
example: ‘Sun Sep 16 01:03:52
1973
’
Profile of ISO 8601:1988, found in modern protocols and
file formats. Formatted as
‘YYYY-MM-DDThh:mm:SS[frac][tz]
’,
where:
YYYY-MM-DD
’T
’T
’ or a space.[frac]
’[tz]
’[+-]HH:?MM
’ or the
letter "Z", signifying UTC.Some examples:
2003-06-02T13:37:42.713Z
’1971-01-02T03:04:05.678+0900
’The touch
utility exits 0 on
success, and >0 if an error occurs. Note: Will exit with failure
when -c
is given but the file doesn't exists.
touch
should be compliant with the IEEE
Std 1003.1-2024 (“POSIX.1”) specification.
-h
and -f
are
extensions.
Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
2023-06-03 | Linux |