Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ touch(1) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

date(1)

ls(1)

utime(2)

touch(1)                                                           touch(1)

NAME
     touch - update access and modification times of a file

SYNOPSIS
     touch [-acm] {-r referencefile | -t time} [--] file ...      Format 1

     touch [-acm] [time] [--] file ...                             Format 2

DESCRIPTION
     touch is used to set the access and modification times of files to the
     current or specified date.

OPTIONS
   Format 1: New synopsis for touch

     No option specified:
           touch sets the time of the last modification and the time of the
           last access for the specified files to the current date. If a
           file does not yet exist touch creates one. Specifying touch
           without an option has the same effect as touch -am.

     -a    (a - access time) touch sets the time of the last access for the
           specified files.

           Neither -a nor -m specified: touch sets the time of the last
           modification and the time of the last access.

     -c    touch does not create files that do not exist. No message is
           output here; the exit status is not set to an error.

     -m    (m - modification time) touch sets the time of the last modifi-
           cation for the specified files.

           Neither -a nor -m specified: touch sets the time of the last
           modification and the time of the last access.

     -r referencefile
           Modification and access time of the file referencefile are used
           instead of the current date.

           -r must not be combined with -t or the obsolete argument time.

     -t time
           The time specified here is used instead of the current date.
           time is specified in the following format:

           [[CC]YY]MMDDhhmm[.SS]

           CC   The first two digits of a year: 19 or 20






Page 1                       Reliant UNIX 5.44                Printed 11/98

touch(1)                                                           touch(1)

                CC not specified:

                If the two-digit year notation YY is in the range 70 to 99,
                the 20th century is assumed; if it is in the range 00 to
                37, the 21st century is assumed. All other entries are
                rejected.

           YY   Two-digit year notation

                Only the digits >69 and <38 may be entered. If the year
                number specified is <38, this is beyond the year 2000.

                YY not specified: The current year is assumed.

           MM   Two-digit month notation (01 through 12)

           DD   Two-digit day notation (01 through 31)

           hh   Two-digit hour notation (00 through 23)

           mm   Two-digit minute notation (00 through 59)

           SS   Two-digit second notation (00 through 61)

                The values 60 and 61 are intended for leap seconds.

                SS not specified: The value 0 seconds is assumed.

           -t must not be combined with -r or the obsolete argument time.

     --    End of the list of options. Must be specified if file begins
           with -.

     file  Name of the input file. touch processes all types of files and
           directories. Several filenames can be specified for each call.

   Format 2: Old synopsis for touch

     time not specified:
           touch sets the access and modification times of the named files
           to the specified or current date. If a file does not exist, it
           is created. Calling touch without options is thus equivalent to
           touch -am.

     -a    Updates only the access time of the named files to the specified
           or current date.

           If neither -a nor -m is specified: touch sets the access and
           modification times of the named files to the specified or
           current date.




Page 2                       Reliant UNIX 5.44                Printed 11/98

touch(1)                                                           touch(1)

     -c    Prevents touch from creating a file if the named file did not
           previously exist. No corresponding message is issued.

     -m    Updates only the modification time of the named files to the
           specified or current date.

           If neither -a nor -m is specified: touch sets both the access
           and modification times of the named files to the specified or
           current date.

     mmddhhmm[yy]
           Date and time to which the access and/or modification times of
           the specified files are to be set. The date/time argument
           comprises eight to ten digits with the following significance:

           month (mm); day (dd); hour (hh); minute (mm); year (yy).

           yy not specified: touch assumes you mean the current year.

           Note: Time notations in this format are obsolete. Filenames con-
           sisting only of digits can cause problems, as touch may be
           interpreted as a date notation. You should replace time with the
           -t option.

     --    End of the list of options. Must be specified if time was not
           specified and file begins with -.

     file  Name of the input file. touch processes all types of files,
           including directories. Several file names may be specified in
           one call.

ERROR MESSAGES
     date: bad conversion

     You have specified an illegal date, e.g. 13010000.

LOCALE
     The LCMESSAGES environment variable governs the language in which
     message texts are displayed. If LCMESSAGES is undefined or is defined
     as the null string, it defaults to the value of LANG. If LANG is like-
     wise undefined or null, the system acts as if it were not internation-
     alized.

     TZ defines the time zone for the -t option.

     The LCALL environment variable governs the entire locale. LCALL
     takes precedence over all the other environment variables which affect
     internationalization.






Page 3                       Reliant UNIX 5.44                Printed 11/98

touch(1)                                                           touch(1)

EXAMPLES
     Example 1

     Set the access and modification times of file to the current date. No
     new file is to be created if this file does not exist.

     $ touch -c file

     The ls -l command can be used to display the time of the last modifi-
     cation; ls -lu outputs the access time.

     Example 2

     Set the access time of file to 9 o'clock on 8/26:

     $ touch -a -t 08260900 file

     $ ls -lu file
     -rw-r--r--   1 bert    ap343       736  Aug 26 09:00 file

SEE ALSO
     date(1), ls(1), utime(2).
































Page 4                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026