shellspells beta

touch

touch [OPTION]... FILE...

touch updates the access and modification times of each FILE to the current time.

Allows you to 'touch' a file. Can be used to create an empty file or update the access/modification times on an existing file. It also has the less well-known ability of allowing you to set a file's modification times to any time you like - handy for covering your tracks...

Examples

Create an empty file

touch new.txt

Update the modification/access times on an exiting file

touch existing.txt

Set the times of a file to the specified time, past or future

# Date format is [[CC]YY]MMDDhhmm[.ss]
$ touch ripley
$ ls -l ripley
-rw-r--r-- 1 garry garry 0 2010-11-07 23:58 ripley
$ touch -t 200512250600 ripley 
$ ls -l  ripley
-rw-r--r-- 1 garry garry 0 2005-12-25 06:00 ripley