| 用途 | 创建空文件 / 更新访问与修改时间 |
|---|---|
| 语法 | touch [选项] 文件... |
| 所属 | GNU coreutils |
常用示例
常用示例
touch newfile.txt
touch app.cpp app.h # 触发 make 重编译
touch -d "2026-10-01 08:00:00" report.txt
touch -c keep.conf # 仅更新时间,文件不存在则跳过touch 已有文件不会清空内容,只改时间;但时间变化会影响基于 mtime 的备份、同步与构建逻辑。