Skip to main content

Use the touch command to change file access and modification times (atime, mtime).

# To create a new empty file(s) or change the times for existing file(s) to current time:
touch <filename>

# To set the times on a file to a specific date and time:
touch -t <YYYYMMDDHHMM.SS> <filename>

# To use the times from a file to set the times on a second file:
touch -r <filename> <filename2>

# To create multiple files:
touch file{1,2,3}.txt