Use the touch command alone to update the file's Atime, CTime, mtime for the moment
[Email protected] ~]# Stat profile
File: "Profile"
size:1796 blocks:8 IO block:4096 Normal file
device:803h/2051d inode:528818 links:1
Access: (0644/-rw-r--r--) Uid: (0/root) Gid: (0/root)
access:2015-04-12 5:44:56.145265376 +0800
modify:2015-04-12 5:44:56.145265376 +0800
change:2015-04-12 5:44:56.145265376 +0800
[[Email protected] ~]# Date
January 19, 2016 Tuesday 20:26:30 CST
[[email protected] ~]# Touch profile
[Email protected] ~]# Stat profile
File: "Profile"
size:1796 blocks:8 IO block:4096 Normal file
device:803h/2051d inode:528818 links:1
Access: (0644/-rw-r--r--) Uid: (0/root) Gid: (0/root)
access:2016-01-19 20:26:38.938555693 +0800
modify:2016-01-19 20:26:38.938555693 +0800
change:2016-01-19 20:26:38.938555693 +0800
Use the command "touch-a-t [YY]MMDDHHMM[.SS] filename" To change the file's Atime
[Email protected] ~]# touch-a-T 06062222 profile
[Email protected] ~]# Stat profile
File: "Profile"
size:1796 blocks:8 IO block:4096 Normal file
device:803h/2051d inode:528818 links:1
Access: (0644/-rw-r--r--) Uid: (0/root) Gid: (0/root)
access:2016-06-06 22:22:00.000000000 +0800
modify:2016-01-19 20:26:38.938555693 +0800
change:2016-01-19 20:30:57.160299376 +0800
Use the command "touch-m-t [YY]MMDDHHMM[.SS] filename" To change the file's Mtime
[[email protected] ~]# touch-m-T 2302030933.33 profile
[[email protected] ~]# stat-profile
F Ile: "Profile"
size:1796 Blocks:8 IO block:4096 Normal file
device:803h/2051d inode: 528818 links:1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
access:2016-06-06 22:22:00.000000000 +0800
modify:2023-02-03 09:33:33.000000000 +0800
change:2016-01-19 20:34:38.521678423 + 0800
using the command "touch-c-t [YY]MMDDHHMM[.SS] filename", you can change the atime and mtime of a file
[[email protected] ~]# touch-c-T 1111111111.11 profile
[[email protected] ~]# stat-profile
File: "Profile"
size:1796 Blocks:8 IO block:4096 Normal file
device:803h/2051d inode:528818 links:1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access:2011-11-11 11:11:11.000000000 +0800
modify:2011-11-11 11:11:11.000000000 +0800
change:2016-01-19 20:35:59.579968164 + 0800
Touch Command cannot modify CTime for a specified time
This article from "Good Freshman only gourd" blog, please be sure to keep this source http://zhuxingye.blog.51cto.com/11121336/1736606
Use the touch command to change atime, Mtime