UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: timexChapter 2
Unix Commands
Next: Reference: tput
 

touch

touch [options] [date] files

For one or more files, update the access time and modification timestamp to the current time and date, or update to the optional date. date is a date and time in the format mmddhhmm[yy]. touch is useful in forcing other commands to handle files a certain way; e.g., the operation of make, and sometimes find, relies on a file's access and modification times.

Options

-a

Update only the access time.

-c

Do not create nonexistent files.

-m

Update only the modification time.

-r file

Use the access and/or modification times of file instead of the current time. Solaris only.

-t time

Use the time as provided by time, which has the form [[cc]yy]mmddhhmm[.ss]. Solaris only.


Previous: Reference: timexUNIX in a Nutshell: System V EditionNext: Reference: tput
Reference: timexBook IndexReference: tput

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System