Home
        <a name=

touch

Change file timestamps, change the access and/or modification times of the specified files.

SYNTAX
      touch [OPTION]... FILE...

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.

-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 [[CC]YY]MMDDhhmm[.ss]
     Use the argument (optional four-digit or two-digit years, months,
     days, hours, minutes, optional seconds) instead of the current
     time.  If the year is specified with with only two digits, then CC
     is 20 for years in the range 0 ... 68, and 19 for year in 69 ...
     99.  If no digits of the year are specified, the argument is
     interpreted as a date in the current year.

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.

"If you play it safe you stagnate is this league. Maybe we'll bust, but if we hit it, we'll hit it big." - Jimmy Johnson, coach of the Miami Dolphins

Related commands:

chgrp - Change group ownership
chmod - Change access permissions
chown - Change file owner and group
date - Display or change the date
which - Show full path of commands