~/CyberRef$


Touch

Touch is used to create a file.

Creating a New File

The command touch fileName will create a new file in your current working dictory. Specifying an extension is not required. You may create multiple files at once by simply listing them out after touch.

Set Custom "Access" and "Modify" Timestamps

You may adjust the timestamp on a file to a date of your choice in the past, present, or future. This is completed through the -t argument. Here's an example:

touch -t 202605302359.59 authLogs.txt

Above sets the timestamp of authLogs.txt to 2026, May 30th, at 23:59:59 (one second to midnight). Providing the year (2023) and seconds (.59) are optional. The "Birth" and "Change" timestamps cannot be modified, this will only update "Access" and "Modify".

Reference

https://linuxhandbook.com/touch-command/