TOUCH(1V)

NAME
touch - update the access and modification times of a file

SYNOPSIS
touch [ -c ] [ -f ] filename...

SYSTEM V SYNOPSIS
/usr/5bin/touch [ -acm ] [ date-time ] filename...

AVAILABILITY
The System V version of this command is available with the System V software installation option. Refer to for information on how to install optional software.

DESCRIPTION
touch sets the access and modification times of each argument to the current time. A file is created if it does not already exist.

touch is valuable when used in conjunction with make(1), where, for instance, you might want to force a complete rebuild of a program composed of many pieces. In such a case, you might type:

        example% touch *.c
        example% make

make(1) would then see that all the .c files were more recent than the corresponding .o files, and would start the compilation from scratch.

OPTIONS

-c  Do not create filename if it does not exist.

-f  Attempt to force the touch in spite of read and write permissions on filename.

SYSTEM V OPTIONS

Options must be grouped to form the first argument. The date-time argument takes the form:

    mmddhhmm[yy]

and updates the modification time to that specified, rather than the current time. The first mm is the month, dd is the day of the month, hh is the hour, and the second mm is the minute. If yy is specified, it is the last two digits of the year. If omitted, the current year is assumed.

-a  Update only the access time.

-c  Do not create filename if it does not exist.

-m  Update only the modification time.

SEE ALSO
make(1), utimes(2)

BUGS
It is difficult to touch a file whose name consists entirely of digits in the System V touch, as it will interpret the first such non-flag argument as a time. You must ensure that there is a character in the name which is not a digit, by specifying it as ./name rather than name.