在 Linux 中,文件有访问时间、数据修改时间、状态修改时间这三个时间,而没有创建时间。
命令名称:stat。
英文原意:display file or file system status。
所在路径:/usr/bin/stat。
执行权限:所有用户。
功能描述:显示文件或文件系统的详细信息。
[root@localhost ~]# stat [选项]文件名或目录名
选项
-f:査看文件所在的文件系统信息,而不是査看文件的信息。
查看文件信息
[root@VM_0_10_centos test]# touch test.txt #创建一个新的文件
[root@VM_0_10_centos test]# stat test.txt #查看文件信息
File: `test.txt'#文件名
Size: 0 #文件大小 Blocks: 0 #占用的block数 IO Block: 4096 #块大小 regular empty file #文件类型
#i节点号 链接数
Device: fc01h/64513d Inode: 98306 Links: 1
#权限 所有者 所属组
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
#访问时间
Access: 2019-07-25 22:25:02.000000000 0800
#数据修改时间
Modify: 2019-07-25 22:25:02.000000000 0800
#状态修改时间
Change: 2019-07-25 22:25:02.000000000 0800