LMLPHP后院

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

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
2024-11-19 04:23:00 1731961380 0.008500