Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ touch(1) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

date

utime

touch

PURPOSE

     Updates the access and modification times of a file.

SYNOPSIS
     touch [ -amc ] [ datetime[yy] ] files


DESCRIPTION

     The  touch command  updates the  access and  modification
     times of each  file or directory named to  the one speci-
     fied on the command line.  If  you do not specify a time,
     touch uses the current time.   If you specify a file that
     does  not exist,  touch  creates a  file  with that  name
     unless you request otherwise with the -c flag.

     The environment variables NLDATE  and NLTIME, if defined,
     specify the order of month and day in the date specifica-
     tion and  of hour and  minute in the  time specification.
     Otherwise, these orders default to mmdd and hhmm.

     The return  code from  touch is the  number of  files for
     which  the  times  could  not  be  successfully  modified
     (including  files  that  did   not  exist  and  were  not
     created).

FLAGS

     -a Changes only the access time.
     -c Does not create the file if it does not already exist.
     -m Changes only the modification time.

EXAMPLES

     1.  To  update the  access  and modification  times of  a
         file:

           touch  program.c

         This sets the last access and last modification times
         of  "program.c" to  the  current date  and time.   If
         "program.c" does  not exist,  touch creates  an empty
         file with that name.
     2.  To avoid creating a new file:

           touch  -c  program.c

     3.  To update only the modification time:

           touch  -m  *.o

         This updates only the  last modification times of the
         files in  the current  directory that end  with ".o".
         touch is often used in  this way to alter the results
         of the make command.
     4.  To explicitly set the access and modification times:

           touch  -c  02171425  program.c

         This sets the access  and modification dates to 14:25
         (2:25 p.m.)  February 17 of the current year.

RELATED INFORMATION

     The following command:  "date."

     The utime  system call in AIX  Operating System Technical
     Reference.

     The "Overview of International Character Support" in Man-
     aging the AIX Operating System.

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