touch:改变文件的访问时间,修改时间,创建文件
[root@host 123]# touch --help
用法:touch [选项]... 文件...
-a 只更改访问时间
-c, --no-create 不创建任何文件
-d, --date=字符串 使用指定字符串表示时间而非当前时间
-h, --no-dereference 会影响符号链接本身,而非符号链接所指示的目的地
(当系统支持更改符号链接的所有者时,此选项才有用)
-m 只更改修改时间
-r, --reference=FILE 使用此文件的时间而不是当前时间
-t STAMP use [[CC]YY]MMDDhhmm[.ss]
• touch -c:不创建不存在的文件
[root@host test]# ls
[root@host test]# touch file
[root@host test]# ls
file
[root@host test]# touch -c file2
[root@host test]# ls
file
• touch -a:修改文件访问时间 —用当前时间更新访问时间
[root@host test]# stat file #stat:查看文件属性信息
文件:"file"
大小:0 块:0 IO 块:4096 普通空文件