touch - Update the access and modification times of each FILE to the current time.
touch [--help] [-a
] [-t ] [-d|--date]
[-f ] [-m ]
[-c|--no-create]
[-h|--no-dereference]
[-r|--reference]
[--time]
[-V|--version] [files]
Update the access and modification times of each FILE to the current time.
Print help information.
change only the access time
<STAMP>use [[CC]YY]MMDDhhmm[.ss] instead of the current time
<STRING>parse argument and use it instead of current time
(ignored)
change only the modification time
do not create any files
affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink)
<FILE>use this files times instead of the current time
<WORD>change only the specified time: "access", "atime", or "use" are equivalent to -a; "modify" or "mtime" are equivalent to -m
Possible values:
atime
mtime
Print version
files]v(uutils coreutils) 0.10.0
Create specific files or update their timestamps if they already exist:
touch path/to/file1 path/to/file2 ...
Set the file [a]ccess or [m]odification times to the current one and dont create file if it doesnt exist:
touch [-c|--no-create] -a|-m path/to/file1 path/to/file2 ...
Set the file [t]ime to a specific value and dont create file if it doesnt exist:
touch [-c|--no-create] -t YYYYMMDDHHMM.SS path/to/file1 path/to/file2 ...
Set the files timestamp to the reference files timestamp, and do not create the file if it does not exist:
touch [-c|--no-create] [-r|--reference] path/to/reference_file path/to/file1 path/to/file2 ...
Set the timestamp by parsing a string:
touch [-d|--date] "last year|5 hours|next thursday|nov 14|..." path/to/file
Create multiple files with an increasing number:
touch path/to/file{1..10}
Create multiple files with a letter range:
touch path/to/file{a..z}
The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.