Linux touch command

touch – change file timestamps

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

A FILE argument that does not exist is created empty, unless -c or -h is supplied.

A FILE argument string of – is handled specially and causes touch to change the times of the file associated
with standard output.

Mandatory arguments to long options are mandatory for short options too.

Use

Example

Change the time record of the file to 11:11 on Feb 01st, 2020. The format of the time can refer to the date command. At least MMDDHHMM must be entered, which is the month, day, hour and minute.
touch -c -t 02011111 file
touch -c -t 020111112020 file
Change the time record of the file to be the same as referencefile.
touch -r referencefile file