Annotation of src/usr.bin/touch/touch.1, Revision 1.34
1.34 ! schwarze 1: .\" $OpenBSD: touch.1,v 1.33 2015/09/12 16:25:32 schwarze Exp $
1.1 deraadt 2: .\" $NetBSD: touch.1,v 1.8 1995/08/31 22:10:05 jtc Exp $
3: .\"
4: .\" Copyright (c) 1991, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" This code is derived from software contributed to Berkeley by
8: .\" the Institute of Electrical and Electronics Engineers, Inc.
9: .\"
10: .\" Redistribution and use in source and binary forms, with or without
11: .\" modification, are permitted provided that the following conditions
12: .\" are met:
13: .\" 1. Redistributions of source code must retain the above copyright
14: .\" notice, this list of conditions and the following disclaimer.
15: .\" 2. Redistributions in binary form must reproduce the above copyright
16: .\" notice, this list of conditions and the following disclaimer in the
17: .\" documentation and/or other materials provided with the distribution.
1.8 millert 18: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 19: .\" may be used to endorse or promote products derived from this software
20: .\" without specific prior written permission.
21: .\"
22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32: .\" SUCH DAMAGE.
33: .\"
34: .\" @(#)touch.1 8.3 (Berkeley) 4/28/95
35: .\"
1.34 ! schwarze 36: .Dd $Mdocdate: September 12 2015 $
1.1 deraadt 37: .Dt TOUCH 1
38: .Os
39: .Sh NAME
40: .Nm touch
41: .Nd change file access and modification times
42: .Sh SYNOPSIS
43: .Nm touch
1.10 otto 44: .Op Fl acm
1.34 ! schwarze 45: .Oo Fl d
1.19 jmc 46: .Sm off
1.33 schwarze 47: .Ar ccyy No - Ar mm No - Ar dd Cm T Ar HH : MM : SS Oo \&. Ar frac Oc Op Cm Z
1.19 jmc 48: .Sm on
1.34 ! schwarze 49: .Oc
1.1 deraadt 50: .Op Fl r Ar file
1.24 jmc 51: .Op Fl t Oo Ns Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS
1.14 sobrado 52: .Ar
1.1 deraadt 53: .Sh DESCRIPTION
54: The
1.5 aaron 55: .Nm
1.1 deraadt 56: utility sets the modification and access times of files to the
57: current time of day.
58: If the file doesn't exist, it is created with default permissions.
59: .Pp
1.4 aaron 60: The options are as follows:
1.1 deraadt 61: .Bl -tag -width Ds
62: .It Fl a
63: Change the access time of the file.
64: The modification time of the file is not changed unless the
65: .Fl m
66: flag is also specified.
67: .It Fl c
68: Do not create the file if it does not exist.
69: The
1.5 aaron 70: .Nm
1.1 deraadt 71: utility does not treat this as an error.
72: No error messages are displayed and the exit value is not affected.
1.33 schwarze 73: .It Xo Fl d
1.19 jmc 74: .Sm off
1.33 schwarze 75: .Ar ccyy No - Ar mm No - Ar dd Cm T Ar HH : MM : SS Oo \&. Ar frac Oc Op Cm Z
1.19 jmc 76: .Sm on
1.33 schwarze 77: .Xc
1.25 jmc 78: Change the access and modification times to the specified time,
1.27 jmc 79: in a format compliant with the
1.28 jmc 80: .St -iso8601
1.27 jmc 81: standard.
1.26 jmc 82: The parts of the argument represent the following:
1.18 guenther 83: .Pp
84: .Bl -tag -width .frac -compact -offset indent
1.24 jmc 85: .It Ar ccyy
86: Year.
87: .It Ar mm
88: Month:
89: a number from 1 to 12.
90: .It Ar dd
91: Day:
92: a number from 1 to 31.
1.33 schwarze 93: .It Cm T
1.18 guenther 94: Either the capital letter
95: .Sq T
96: or a single space.
1.29 millert 97: If a space is used, the argument should be quoted to
98: prevent the shell from splitting it into multiple words.
1.24 jmc 99: .It Ar HH
100: Hour:
101: a number from 0 to 23.
102: .It Ar MM
103: Minute:
104: a number from 0 to 59.
1.18 guenther 105: .It Ar SS
1.24 jmc 106: Second:
107: a number from 0 to 60
108: (permitting a leap second).
109: .It Ar frac
1.21 jmc 110: The decimal fraction of the second,
111: either a period or comma,
112: followed by one or more decimal digits.
1.33 schwarze 113: .It Cm Z
1.30 jmc 114: The timezone specifier: a capital letter
1.18 guenther 115: .Sq Z
116: indicating that the time is in UTC.
117: If not specified, the time is in the local timezone.
118: .El
1.1 deraadt 119: .It Fl m
120: Change the modification time of the file.
121: The access time of the file is not changed unless the
122: .Fl a
123: flag is also specified.
1.11 jmc 124: .It Fl r Ar file
1.7 henning 125: Use the access and modification times from the specified file
1.1 deraadt 126: instead of the current time of day.
1.24 jmc 127: .It Fl t Oo Ns Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS
1.25 jmc 128: Change the access and modification times to the specified time,
1.20 jmc 129: where the parts of the argument represent the following:
1.1 deraadt 130: .Pp
131: .Bl -tag -width Ds -compact -offset indent
1.24 jmc 132: .It Ar ccyy
133: Year.
134: If yy is specified, but cc is not,
135: a value for yy between 69 and 99 results in a cc value of 19.
136: Otherwise, a cc value of 20 is used.
137: .It Ar mm
138: Month:
139: a number from 1 to 12.
140: .It Ar dd
141: Day:
142: a number from 1 to 31.
143: .It Ar HH
144: Hour:
145: a number from 0 to 23.
1.1 deraadt 146: .It Ar MM
1.24 jmc 147: Minute:
148: a number from 0 to 59.
149: .It Ar SS
150: Second:
151: a number from 0 to 60
152: (permitting a leap second),
1.21 jmc 153: preceded by a period.
1.24 jmc 154: The default is 0.
1.1 deraadt 155: .El
156: .El
1.17 jmc 157: .Sh EXIT STATUS
1.15 sobrado 158: .Ex -std touch
1.1 deraadt 159: .Sh SEE ALSO
1.22 jmc 160: .Xr date 1
1.9 jmc 161: .Sh STANDARDS
1.12 jmc 162: The
163: .Nm
164: utility is compliant with the
1.16 jmc 165: .St -p1003.1-2008
1.32 jmc 166: specification.
1.12 jmc 167: .Pp
1.1 deraadt 168: The obsolescent form of
169: .Nm touch ,
170: where a time format is specified as the first argument, is supported.
171: When no
1.21 jmc 172: .Fl d , r ,
1.1 deraadt 173: or
174: .Fl t
175: option is specified, there are at least two arguments, and the first
176: argument is a string of digits either eight or ten characters in length,
177: the first argument is interpreted as a time specification of the form
1.24 jmc 178: .Dq mmddHHMM[yy] .
1.5 aaron 179: .Sh HISTORY
180: A
181: .Nm
182: utility appeared in
1.6 pjanzen 183: .At v7 .