touch
TLDR
Create a new empty file
SYNOPSIS
touch [options] file...
DESCRIPTION
touch updates file access and modification timestamps. If the file doesn't exist, touch creates an empty file (unless -c is specified).
Common uses include creating empty files, updating timestamps to trigger make rebuilds, and setting specific times for testing or archival purposes.
Time can be specified in several formats: -t for precise timestamps, -d for human-readable strings ("yesterday", "2 hours ago"), or -r to copy times from another file.
Without -a or -m, both access time (atime) and modification time (mtime) are updated. Change time (ctime) is always updated by the kernel when timestamps change.
PARAMETERS
-a
Change only access time-m
Change only modification time-c, --no-create
Do not create file if it doesn't exist-d string, --date=string
Parse string and use instead of current time-r file, --reference=file
Use times from reference file-t stamp
Use timestamp [[CC]YY]MMDDhhmm[.ss] instead of current time-h, --no-dereference
Affect symbolic link instead of referenced file
DATE STRING EXAMPLES
CAVEATS
Creating files requires write permission in the directory. Updating timestamps requires write permission on the file or ownership.
Some filesystems mount with noatime or relatime, which affects how access times are recorded. This doesn't affect touch but may affect programs relying on atime.
Touch cannot change ctime (inode change time); it's always set to current time by the kernel when metadata changes.


