man pages section 1: User Commands

Exit Print View

Updated: July 2014
 
 

touch(1B)

Name

touch - change file access and modification times

Synopsis

/usr/ucb/touch [-acfm] 
file...

Description

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

Options

–a

Change the access time of file. Do not change the modification time unless –m is also specified.

–c

Do not create file if it does not exist.

–f

Attempt to force the touch in spite of read and write permissions on file.

–m

Change the modification time of file. Do not change the access time unless –a is also specified.

Usage

See largefile(5) for the description of the behavior of touch when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

Exit Status

The following exit values are returned:

0

touch executed successfully and all requested changes were made.

>0

An error occurred. touch returns the number of files for which the times could not be successfully modified.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
compatibility/ucb

See also

touch(1), attributes(5), largefile(5)

Notes

This command is obsolete and will be removed in a future release of Oracle Solaris. See touch(1) for an alternate implementation of this command. The command touch(1B) has a – f option that touch(1) does not have; this option is ignored by touch(1).