“在Linux下查看文件三种时间”的版本间的差异

来自YTYZX有图有真相的百科
跳转至: 导航搜索
第3行: 第3行:
 
  mtime(modify time):最近修改文件内容时间(Last Modification Time)。
 
  mtime(modify time):最近修改文件内容时间(Last Modification Time)。
 
  ctime(change time):最近更改文件属性的时间,包括文件名、大小、内容、权限、属主、属组等(Last Change Time)。
 
  ctime(change time):最近更改文件属性的时间,包括文件名、大小、内容、权限、属主、属组等(Last Change Time)。
 +
 
  1.输入“stat anaconda-ks.cfg”即可查看文件anaconda-ks.cfg的时间属性。
 
  1.输入“stat anaconda-ks.cfg”即可查看文件anaconda-ks.cfg的时间属性。
 
    备注:Birth时间为空,Linux需要内核提供xstat()接口才可获取Birth时间。
 
    备注:Birth时间为空,Linux需要内核提供xstat()接口才可获取Birth时间。

2019年1月5日 (六) 19:32的版本

在Linux下,文件包含三种时间属性,分别为:

atime(access time):最近访问文件内容时间(Last Access Time)。
mtime(modify time):最近修改文件内容时间(Last Modification Time)。
ctime(change time):最近更改文件属性的时间,包括文件名、大小、内容、权限、属主、属组等(Last Change Time)。

1.输入“stat anaconda-ks.cfg”即可查看文件anaconda-ks.cfg的时间属性。
  备注:Birth时间为空,Linux需要内核提供xstat()接口才可获取Birth时间。

File3P1.png

ls -lc filename 查看文件的 ctime
ls -lu filename 查看文件的 atime
ls -l filename  查看文件的 mtime