【笔记】Touch学习笔记
前言
touch是一个UNIX shell命令,其主要功能是将现有文件的修改时间戳设置为当前时间,它也被用于创建新文件。(维基百科)
创建一个文件
1 | touch <file> |
创建文件时定义修改时间
1 | touch -t 197001010000.00 <file> |
1 | touch -d "1970-01-01 00:00:00" <file> |
创建文件时复制其他文件的修改时间
- 创建文件时复制其他文件的修改时间作为新文件的修改时间
1 | touch -r <file_old> <file_new> |