利用stat指令查看文件信息

三种时间的介绍
ATime ——文件的最近访问时间
只要读取时间,ATime就会更新

MTime ——文件的内容最近修改的时间
当文件进行被写的时候,CTime就会更新

CTime——文件属性最近修改的时间
当文件的目录被修改,或者文件的所有者,权限等被修改时
CTime也就会更新

如何利用touch指令进行文件的时间修改?
touch指令的介绍
touch修改时间
touch不仅可以创建文件,还可以对其进行时间的一些修改
格式:touch 参数 文件名
参数:
-a:或–time=atime或–time=access或–time=use
-c:或–no-creat,如果棉花地文件不存在,也不创建任何文档
-d:使用指定的日期时间,可以使用不同的格式
-m:或–time=mtime或–time=modify,改变修改时间
-r:把指定的文件日期更设成和参考文档或目录日期相同的时间
-t:使用指定的日期时间,格式与date指令相同
使用touch指令
1、利用touch指令创建一个文件

2、利用touch修改ATime

3、touch -d 使用指定的日期来修改

4、将文件1的时间设置成文件2的时间

来源:https://www.2cto.com/kf/201803/727024.html