touch.1 (1686B)
- .\" Collection of Unix tools, comparable to coreutils
- .\" Copyright 2023 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2023-06-03
- .Dt TOUCH 1
- .Os
- .Sh NAME
- .Nm touch
- .Nd change file access and modification times
- .Sh SYNOPSIS
- .Nm
- .Op Fl achm
- .Op Fl d Ar datetime | Fl r Ar ref_file
- .Ar file...
- .Sh DESCRIPTION
- .Nm
- changes the date modification and access times on each
- .Ar file
- it is given.
- .Bl -tag -width Ds
- .It Fl a
- Change the access time, no changes to modification time unless
- .Fl m
- is also given.
- .It Fl c
- Do not create
- .Ar file .
- .It Fl h
- Do not follow symlinks.
- .It Fl m
- Change the modification time, no changes to access time unless
- .Fl a
- is also given.
- .It Fl d Ar datetime
- Use the specified
- .Ar datetime
- instead of the current time.
- Should be formatted as
- .Ql YYYY-MM-DDThh:mm:SS[frac][Z] ,
- where:
- .Bl -tag -width Ds
- .It Ql YYYY-MM-DD
- Corresponds to %Y-%m-%d of
- .Xr strptime 3 .
- .It Ql T
- Is either
- .Ql T
- or a space.
- .It Ql [frac]
- Is either empty, or fractional seconds starting with either a comma
- .Pq \&,
- or a period
- .Pq \&. .
- .It Ql [Z]
- Is either empty, signifying local time, or the letter
- .Qq Z ,
- signifying UTC.
- .El
- .Pp
- For example:
- .Ql 2003-06-02T13:37:42.713Z
- .It Fl r Ar ref_file
- Use the corresponding times of the file at
- .Ar ref_file
- instead of the current time.
- .El
- .Sh EXIT STATUS
- .Ex -std
- Note: Will exit with failure when
- .Fl c
- is given but the file doesn't exists.
- .Sh SEE ALSO
- .Xr stat 1 ,
- .Xr futimens 3
- .Sh STANDARDS
- .Nm
- is mostly compliant with the
- .St -p1003.1-2008
- specification.
- .Fl t
- is intentionally missing.
- .Fl h
- is an extension.
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me