I. Viewing file time and related commands
1. Stat View file time
[Email protected] ~]# stat install.log File: "Install.log" size:33386 blocks:80 IO block:4096 General file device:fd00h/64768d inode:7692962 links:1access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) access:2012-07-13 16:02:34.000000000 +0800modify:2011-11-29 16:03:06.000000000 + 0800change:2011-11-29 16:03:08.000000000 +0800
Description: Access time for access. Modify modification time. Change state changes time. Can stat * View the status of all files in this directory.
And we want to see the specific time of the three time of a file, and save it in the format of days and seconds. We can use the following command:
[Email protected] ~]# Stat install.log|grep-i Modify | Awk-f. ' {print $} ' | awk ' {print $2$3} ' | awk-f-' {print $1$2$3} ' | Awk-f: ' {print $1$2$3} ' 20111129160306
View and modify file times under Linux