Go to the first, previous, next, last section, table of contents.


touch: Change file timestamps

touch changes the access and/or modification times of the specified files. Synopsis:

touch [option]... file...

If the first file would be a valid argument to the `-t' option and no timestamp is given with any of the `-d', `-r', or `-t' options and the `--' argument is not given, that argument is interpreted as the time for the other files instead of as a file name.

Any file that does not exist is created empty.

If changing both the access and modification times to the current time, touch can change the timestamps for files that the user running it does not own but has write permission for. Otherwise, the user must own the files.

The program accepts the following options. Also see section Common options.

`-a'
`--time=atime'
`--time=access'
`--time=use'
Change the access time only.
`-c'
`--no-create'
Do not create files that do not exist.
`-d'
`--date=time'
Use time instead of the current time. It can contain month names, timezones, `am' and `pm', etc. See section Date input formats.
`-f'
Ignored; for compatibility with BSD versions of touch.
`-m'
`--time=mtime'
`--time=modify'
Change the modification time only.
`-r file'
`--reference=file'
Use the times of the reference file instead of the current time.
`-t MMDDhhmm[[CC]YY][.ss]'
Use the argument (months, days, hours, minutes, optional century and years, optional seconds) instead of the current time.


Go to the first, previous, next, last section, table of contents.