Create an empty file or update timestamps
low risk
Creates the file if it does not exist, otherwise updates its modification time. Often used to create placeholders or reset mtime for make/rsync.
| Flag | Meaning |
|---|---|
-c | Do not create missing files |
-t | Set a specific timestamp [[CC]YY]MMDDhhmm |
-r | Copy timestamps from another file |
touch notes.txtCreate an empty file · explain & risk-check →touch -r a.txt b.txtGive b.txt the same mtime as a.txt · explain & risk-check →Reference text is hand-written and may be incomplete — check man touch for your version. Test destructive commands on a non-production system first.