LMLPHP后院

使用stat命令查看文件详细信息

原文链接 : http://blog.lmlphp.com/tutorial/1/SHELL/item/3/Use_stat_command_to_view_file_details_info  来自 : LMLPHP后院

stat 命令可以查看文件的所有状态信息,如下示例:

$ stat a.txt
  File: 'a.txt'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 804h/2052d      Inode: 1049097     Links: 2
Access: (0644/-rw-r--r--)  Uid: ( 1000/     may)   Gid: ( 1000/     may)
Access: 2016-12-15 15:46:11.335281568 +0800
Modify: 2016-12-15 15:46:11.335281568 +0800
Change: 2016-12-15 15:46:31.329007725 +0800
 Birth: -

使用 file 命令查看文件类型:

$ file a.txt
a.txt: empty
$ test echo 'test' > a.txt
$ test file a.txt
a.txt: ASCII text
$ file /usr/bin/php
/usr/bin/php: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=def191bc34a876db92a4b039d5e95aa44acc37ae, stripped
LMLPHP,可爱滴WEB开发框架

2017-09-23 04:27:39 1506112059 0.003421