当前位置: 技术问答>linux和unix
关于文件的access time
来源: 互联网 发布时间:2017-03-24
本文导语: 网上都说cat操作会修改文件的access time,但是几次试验下来,结果是,touch某文件后第一次执行cat后能修改access time,以后再cat后就不会改变文件的access time了,不明白是什么原因,各位知道什么原因吗? root@gmdz-virt...
网上都说cat操作会修改文件的access time,但是几次试验下来,结果是,touch某文件后第一次执行cat后能修改access time,以后再cat后就不会改变文件的access time了,不明白是什么原因,各位知道什么原因吗?
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:00:27.496376308 +0800
Modify: 2012-11-26 11:00:08.288376444 +0800
Change: 2012-11-26 11:00:08.288376444 +0800
root@gmdz-virtual-machine:~/test# touch 1
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:21.192376360 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test# cat 1
21321
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:28.304376847 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test# cat 1
21321
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:28.304376847 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test# cat 1
21321
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:28.304376847 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test#
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:00:27.496376308 +0800
Modify: 2012-11-26 11:00:08.288376444 +0800
Change: 2012-11-26 11:00:08.288376444 +0800
root@gmdz-virtual-machine:~/test# touch 1
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:21.192376360 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test# cat 1
21321
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:28.304376847 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test# cat 1
21321
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:28.304376847 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test# cat 1
21321
root@gmdz-virtual-machine:~/test# stat 1
File: "1"
Size: 6 Blocks: 8 IO Block: 4096 普通文件
Device: 801h/2049d Inode: 24117265 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-11-26 11:03:28.304376847 +0800
Modify: 2012-11-26 11:03:21.192376360 +0800
Change: 2012-11-26 11:03:21.192376360 +0800
root@gmdz-virtual-machine:~/test#
|