[BACK]Return to touch.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / touch

Annotation of src/usr.bin/touch/touch.1, Revision 1.9

1.9     ! jmc         1: .\"    $OpenBSD: touch.1,v 1.8 2003/06/03 02:56:20 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: .\"
                     36: .Dd April 28, 1995
                     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
                     44: .Op Fl acfm
                     45: .Op Fl r Ar file
                     46: .Op Fl t Ar [[CC]YY]MMDDhhmm[.SS]
1.3       aaron      47: .Ar file Op Ar ...
1.1       deraadt    48: .Sh DESCRIPTION
                     49: The
1.5       aaron      50: .Nm
1.1       deraadt    51: utility sets the modification and access times of files to the
                     52: current time of day.
                     53: If the file doesn't exist, it is created with default permissions.
                     54: .Pp
1.4       aaron      55: The options are as follows:
1.1       deraadt    56: .Bl -tag -width Ds
                     57: .It Fl a
                     58: Change the access time of the file.
                     59: The modification time of the file is not changed unless the
                     60: .Fl m
                     61: flag is also specified.
                     62: .It Fl c
                     63: Do not create the file if it does not exist.
                     64: The
1.5       aaron      65: .Nm
1.1       deraadt    66: utility does not treat this as an error.
                     67: No error messages are displayed and the exit value is not affected.
                     68: .It Fl f
                     69: Attempt to force the update, even if the file permissions do not
                     70: currently permit it.
                     71: .It Fl m
                     72: Change the modification time of the file.
                     73: The access time of the file is not changed unless the
                     74: .Fl a
                     75: flag is also specified.
                     76: .It Fl r
1.7       henning    77: Use the access and modification times from the specified file
1.1       deraadt    78: instead of the current time of day.
                     79: .It Fl t
                     80: Change the access and modification times to the specified time.
                     81: The argument should be in the form
                     82: .Dq [[CC]YY]MMDDhhmm[.SS]
                     83: where each pair of letters represents the following:
                     84: .Pp
                     85: .Bl -tag -width Ds -compact -offset indent
                     86: .It Ar CC
                     87: The first two digits of the year (the century).
                     88: .It Ar YY
                     89: The second two digits of the year.
                     90: If
                     91: .Dq YY
                     92: is specified, but
                     93: .Dq CC
                     94: is not, a value for
                     95: .Dq YY
                     96: between 69 and 99 results in a
                     97: .Dq CC
                     98: value of 19.
                     99: Otherwise, a
                    100: .Dq CC
                    101: value of 20 is used.
                    102: .It Ar MM
                    103: The month of the year, from 1 to 12.
                    104: .It Ar DD
1.3       aaron     105: The day of the month, from 1 to 31.
1.1       deraadt   106: .It Ar hh
                    107: The hour of the day, from 0 to 23.
                    108: .It Ar mm
                    109: The minute of the hour, from 0 to 59.
                    110: .It Ar SS
                    111: The second of the minute, from 0 to 61.
                    112: .El
                    113: .Pp
                    114: If the
                    115: .Dq CC
                    116: and
                    117: .Dq YY
                    118: letter pairs are not specified, the values default to the current
                    119: year.
                    120: If the
                    121: .Dq SS
                    122: letter pair is not specified, the value defaults to 0.
                    123: .El
                    124: .Pp
                    125: The
1.5       aaron     126: .Nm
1.3       aaron     127: utility exits 0 on success or >0 if an error occurred.
1.1       deraadt   128: .Sh SEE ALSO
                    129: .Xr utimes 2
1.9     ! jmc       130: .Sh STANDARDS
1.1       deraadt   131: The obsolescent form of
                    132: .Nm touch ,
                    133: where a time format is specified as the first argument, is supported.
                    134: When no
                    135: .Fl r
                    136: or
                    137: .Fl t
                    138: option is specified, there are at least two arguments, and the first
                    139: argument is a string of digits either eight or ten characters in length,
                    140: the first argument is interpreted as a time specification of the form
                    141: .Dq MMDDhhmm[YY] .
                    142: .Pp
                    143: The
                    144: .Dq MM ,
                    145: .Dq DD ,
                    146: .Dq hh
                    147: and
                    148: .Dq mm
                    149: letter pairs are treated as their counterparts specified to the
                    150: .Fl t
                    151: option.
                    152: If the
                    153: .Dq YY
1.6       pjanzen   154: letter pair is in the range 69 to 99, the year is set from 1969 to 1999;
1.1       deraadt   155: otherwise, the year is set in the 21st century.
1.9     ! jmc       156: .Pp
1.1       deraadt   157: The
1.5       aaron     158: .Nm
1.1       deraadt   159: utility is expected to be a superset of the
                    160: .St -p1003.2
                    161: specification.
1.5       aaron     162: .Sh HISTORY
                    163: A
                    164: .Nm
                    165: utility appeared in
1.6       pjanzen   166: .At v7 .