2014-02-11 00:35:16 +00:00
|
|
|
# touch
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Change a file access and modification times (atime, mtime).
|
2021-03-23 18:19:37 +00:00
|
|
|
> More information: <https://man7.org/linux/man-pages/man1/touch.1.html>.
|
2014-02-11 00:35:16 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Create a new empty file(s) or change the times for existing file(s) to current time:
|
2014-02-11 00:35:16 +00:00
|
|
|
|
|
|
|
`touch {{filename}}`
|
|
|
|
|
2016-01-20 11:44:25 +00:00
|
|
|
- Set the times on a file to a specific date and time:
|
2014-02-11 00:35:16 +00:00
|
|
|
|
2015-12-31 13:11:18 +00:00
|
|
|
`touch -t {{YYYYMMDDHHMM.SS}} {{filename}}`
|
2014-02-11 00:35:16 +00:00
|
|
|
|
2016-01-20 11:44:25 +00:00
|
|
|
- Use the times from a file to set the times on a second file:
|
2014-02-11 00:35:16 +00:00
|
|
|
|
2016-01-20 11:44:25 +00:00
|
|
|
`touch -r {{filename}} {{filename2}}`
|