Stat命令与文件时间
stat命令
stat命令常用来获取文件三个时间access time
,modify time
和change time
$ stat access.log
File: `access.log'
Size: 1559877779 Blocks: 3049624 IO Block: 4096 regular file
Device: ca20h/51744d Inode: 16269326 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 500/ work) Gid: ( 500/ work)
Access: 2014-03-09 21:58:33.000000000 +0800
Modify: 2014-03-07 08:17:36.000000000 +0800
Change: 2014-03-07 08:17:36.000000000 +0800
通常可以使用-c
参数直接获取三个时间
$ stat -c %x access.log #获取access time
2014-03-09 21:58:33.000000000 +0800
$ stat -c %y access.log #获取modify time
2014-03-07 08:17:36.000000000 +0800
$ stat -c %z access.log #获取change time
2014-03-07 08:17:36.000000000 +0800
Read on →