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