Annotation of src/usr.bin/touch/touch.1, Revision 1.33
1.33 ! schwarze 1: .\" $OpenBSD: touch.1,v 1.32 2014/06/03 15:56:53 jmc 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.32 jmc 36: .Dd $Mdocdate: June 3 2014 $
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.33 ! schwarze 45: .Op 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.1 deraadt 49: .Op Fl r Ar file
1.24 jmc 50: .Op Fl t Oo Ns Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS
1.14 sobrado 51: .Ar
1.1 deraadt 52: .Sh DESCRIPTION
53: The
1.5 aaron 54: .Nm
1.1 deraadt 55: utility sets the modification and access times of files to the
56: current time of day.
57: If the file doesn't exist, it is created with default permissions.
58: .Pp
1.4 aaron 59: The options are as follows:
1.1 deraadt 60: .Bl -tag -width Ds
61: .It Fl a
62: Change the access time of the file.
63: The modification time of the file is not changed unless the
64: .Fl m
65: flag is also specified.
66: .It Fl c
67: Do not create the file if it does not exist.
68: The
1.5 aaron 69: .Nm
1.1 deraadt 70: utility does not treat this as an error.
71: No error messages are displayed and the exit value is not affected.
1.33 ! schwarze 72: .It Xo Fl d
1.19 jmc 73: .Sm off
1.33 ! schwarze 74: .Ar ccyy No - Ar mm No - Ar dd Cm T Ar HH : MM : SS Oo \&. Ar frac Oc Op Cm Z
1.19 jmc 75: .Sm on
1.33 ! schwarze 76: .Xc
1.25 jmc 77: Change the access and modification times to the specified time,
1.27 jmc 78: in a format compliant with the
1.28 jmc 79: .St -iso8601
1.27 jmc 80: standard.
1.26 jmc 81: The parts of the argument represent the following:
1.18 guenther 82: .Pp
83: .Bl -tag -width .frac -compact -offset indent
1.24 jmc 84: .It Ar ccyy
85: Year.
86: .It Ar mm
87: Month:
88: a number from 1 to 12.
89: .It Ar dd
90: Day:
91: a number from 1 to 31.
1.33 ! schwarze 92: .It Cm T
1.18 guenther 93: Either the capital letter
94: .Sq T
95: or a single space.
1.29 millert 96: If a space is used, the argument should be quoted to
97: prevent the shell from splitting it into multiple words.
1.24 jmc 98: .It Ar HH
99: Hour:
100: a number from 0 to 23.
101: .It Ar MM
102: Minute:
103: a number from 0 to 59.
1.18 guenther 104: .It Ar SS
1.24 jmc 105: Second:
106: a number from 0 to 60
107: (permitting a leap second).
108: .It Ar frac
1.21 jmc 109: The decimal fraction of the second,
110: either a period or comma,
111: followed by one or more decimal digits.
1.33 ! schwarze 112: .It Cm Z
1.30 jmc 113: The timezone specifier: a capital letter
1.18 guenther 114: .Sq Z
115: indicating that the time is in UTC.
116: If not specified, the time is in the local timezone.
117: .El
1.1 deraadt 118: .It Fl m
119: Change the modification time of the file.
120: The access time of the file is not changed unless the
121: .Fl a
122: flag is also specified.
1.11 jmc 123: .It Fl r Ar file
1.7 henning 124: Use the access and modification times from the specified file
1.1 deraadt 125: instead of the current time of day.
1.24 jmc 126: .It Fl t Oo Ns Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS
1.25 jmc 127: Change the access and modification times to the specified time,
1.20 jmc 128: where the parts of the argument represent the following:
1.1 deraadt 129: .Pp
130: .Bl -tag -width Ds -compact -offset indent
1.24 jmc 131: .It Ar ccyy
132: Year.
133: If yy is specified, but cc is not,
134: a value for yy between 69 and 99 results in a cc value of 19.
135: Otherwise, a cc value of 20 is used.
136: .It Ar mm
137: Month:
138: a number from 1 to 12.
139: .It Ar dd
140: Day:
141: a number from 1 to 31.
142: .It Ar HH
143: Hour:
144: a number from 0 to 23.
1.1 deraadt 145: .It Ar MM
1.24 jmc 146: Minute:
147: a number from 0 to 59.
148: .It Ar SS
149: Second:
150: a number from 0 to 60
151: (permitting a leap second),
1.21 jmc 152: preceded by a period.
1.24 jmc 153: The default is 0.
1.1 deraadt 154: .El
155: .El
1.17 jmc 156: .Sh EXIT STATUS
1.15 sobrado 157: .Ex -std touch
1.1 deraadt 158: .Sh SEE ALSO
1.22 jmc 159: .Xr date 1
1.9 jmc 160: .Sh STANDARDS
1.12 jmc 161: The
162: .Nm
163: utility is compliant with the
1.16 jmc 164: .St -p1003.1-2008
1.32 jmc 165: specification.
1.12 jmc 166: .Pp
1.1 deraadt 167: The obsolescent form of
168: .Nm touch ,
169: where a time format is specified as the first argument, is supported.
170: When no
1.21 jmc 171: .Fl d , r ,
1.1 deraadt 172: or
173: .Fl t
174: option is specified, there are at least two arguments, and the first
175: argument is a string of digits either eight or ten characters in length,
176: the first argument is interpreted as a time specification of the form
1.24 jmc 177: .Dq mmddHHMM[yy] .
1.5 aaron 178: .Sh HISTORY
179: A
180: .Nm
181: utility appeared in
1.6 pjanzen 182: .At v7 .