~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: ef38ed2082a808feca4448acb8c32fbe161cdd77
parent 8aa1fae195e1237b0823328ff13a20514aa68793
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat,  3 Jun 2023 05:00:37 +0200

cmd/touch.1: Add manpage


1 file changed, 81 insertions(+), 0 deletions(-)

diff --git a/cmd/touch.1 b/cmd/touch.1 @@ -0,0 +1,81 @@ +.\" Collection of Unix tools, comparable to coreutils +.\" Copyright 2023 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> +.\" SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only +.Dd 2024-06-03 +.Dt TOUCH 1 +.Os +.Sh NAME +.Nm touch +.Nd change file access and modification times +.Sh SYNOPSIS +.Nm +.Op Fl acm +.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 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) +.Sh AUTHORS +.An Haelwenn (lanodan) Monnier Aq Mt contact@hacktivis.me