touch command
Create empty files or update file timestamps.
- Files & directories
- Package coreutils
- 5 options · 5 examples
On this page
Syntax
touch [options] file…Provided by the coreutils package. Run man touch for the full manual.
Common options
| Option | What it does |
|---|---|
-a | Change only the access time |
-m | Change only the modification time |
-c | Don't create files that don't exist |
-d DATE | Use this date instead of now |
-r FILE | Copy the timestamps of FILE |
Examples
Create an empty file
touch notes.txtCreate several files
touch a.txt b.txt c.txtSet a specific date
touch -d "2026-01-01 10:00" file.txtCopy timestamps from another file
touch -r original.txt copy.txtUpdate the time only if the file exists
touch -c app.log
No example matches. Check the options table or search the guides.
