潜龙勿用,见龙在田
全部博文(540)
分类: LINUX
2009-05-05 15:42:09
[root@test200 temp]# stat libnids-1.16.tar.gzaccess time是文档最后一次被读取的时间。因此阅读一个文档会更新它的access时间,但它的modify时间和change时间并没有变化。cat、more 、less、grep、sed、tail、head这些命令都会修改文件的access时间。
File: `libnids-1.16.tar.gz'
Size: 72309 Blocks: 152 IO Block: 4096 regular file
Device: 302h/770d Inode: 4113144 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2008-05-27 15:13:03.000000000 +0800
Modify: 2004-03-10 12:25:09.000000000 +0800
Change: 2008-05-27 14:18:18.000000000 +0800
st_atimechmod, chown,create,mv等动作会将Linux文件的change time修改为系统当前时间
Time when file data was last accessed. Changed by the
following functions: creat(), mknod(), pipe(),
utime(2), and read(2).
st_mtime
Time when data was last modified. Changed by the fol-
lowing functions: creat(), mknod(), pipe(), utime(),
and write(2).
st_ctime
Time when file status was last changed. time of last modification of file status information.Changed by the
following functions: chmod(), chown(), creat(),
link(2), mknod(), pipe(), unlink(2), utime(), and
write().
ls -lu (show files access time and sort by name)如果加上-t参数,则按相应的时间排序后显示。加上--time-style=full-iso,则会把文件的相应年月日时分秒time全部显示出来。
ls -lc (show files change time and sort by name )
ls -l (show files modify time and sort by name )
时间类型 |
find |
查看 | 常见影响对应时间的操作 |
|
access time | atime | ls -lu | cat,more,less,head,tail,sed,grep,awk,file 可执行文件被执行;音频视频文件被播放; | |
modify time | mtime | ls -l | 文件内容修改、写入 |
|
change time | ctime | ls -lc | chmod,chown,mv,create,usermod,chgrp,ln |