TOUCH(1V) — USER COMMANDS
NAME
touch − update times of last access and modification of a file
SYNOPSIS
touch [ −c ] [ −f ] filename ...
SYSTEM V SYNOPSIS
touch [ −c ] [ −a ] [ −m ] [ mmddhhmm[yy] ] filename ...
DESCRIPTION
touch causes the access and modification times of each argument to be set 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:
% touch ∗.c
% make
make would then see that all the .c files were more recent than the corresponding .o files, and would start the compilation from scratch.
OPTIONS
−cDo not create filename if it does not exist.
−fAttempt to force the touch in spite of read and write permissions on filename.
SYSTEM V OPTIONS
−a Update only the access time.
−m Update only the modification time.
mmddhhmm[yy]
Update the times to the specified time rather than to 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, otherwise the current year is used.
SEE ALSO
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.
Sun Release 3.5 — Last change: 24 April 1986