touch¶
Change file access and modification times.
Synopsis¶
Description¶
Update the access and modification times of each FILE to the current time. A FILE argument that does not exist is created empty, unless -c is supplied.
Flags¶
| Flag | Short | Description | Default |
|---|---|---|---|
--no-create |
-c |
Do not create any files | false |
--access-only |
-a |
Change only the access time | false |
--modify-only |
-m |
Change only the modification time | false |
--reference |
-r |
Use this file's times instead of current time | |
--date |
-d |
Parse date string and use instead of current time |
Examples¶
Create an empty file or update timestamps:
Create multiple files:
Don't create if doesn't exist:
Use timestamps from another file:
Set specific date:
Change only access time:
Change only modification time:
Supported Date Formats¶
2006-01-02T15:04:05(ISO 8601)2006-01-02 15:04:052006-01-02T15:042006-01-02 15:042006-01-02Jan 2, 2006Jan 2 200602 Jan 2006