曲径通幽论坛

标题: ctime,mtime,atime [打印本页]

作者: beyes    时间: 2009-1-5 03:37
标题: ctime,mtime,atime
mtime : modification time
ctime  :  status time
atime  :  access time

先看一下 pass.txt 这个文件的 ctime
[beyes@localhost ~]$ ls -l --time=ctime pass.txt
-rw-rw-r-- 1 beyes beyes 154 01-05 02:14 pass.txt

改变一下文件的属性后再看看:
[beyes@localhost ~]$ chmod 755 pass.txt
[beyes@localhost ~]$ ls -l --time=ctime pass.txt
-rwxr-xr-x 1 beyes beyes 154 01-05 03:32 pass.txt

从上面看到,文件的属性改变了,这个 ctime 也就发生了变化。

看一下这个文件的 mtime
[beyes@localhost ~]$ ls -l pass.txt
-rwxr-xr-x 1 beyes beyes 154 01-05 02:14 pass.txt

现在修改一下 pass.txt 中的内容:
[beyes@localhost ~]$ ls -l pass.txt
-rwxr-xr-x 1 beyes beyes 161 01-05 03:36 pass.txt

再看一下 atime:
[beyes@localhost ~]$ ls -l --time=atime pass.txt
-rwxr-xr-x 1 beyes beyes 161 01-05 03:36 pass.txt

三分钟后,用 cat 命令来查看一下文件然后再看看 atime:
[beyes@localhost ~]$ cat pass.txt
yes:no:hi:hello:maybe:welcome

ok:awk:bird:amd:tmd:intel:ati

name:linux:unix:gnu:bsd:open
suse:ubuntu:fedora:redhat:now
china:usa:korea:japan:enland:old

mtime
[beyes@localhost ~]$ ls -l --time=atime pass.txt
-rwxr-xr-x 1 beyes beyes 161 01-05 03:39 pass.txt





欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2