stat命令(获取文件信息)

>ll
drwxr-xr-x 3 root root 72 2010-04-28 16:29 test

>stat test
  File: `test'
  Size: 72              Blocks: 0          IO Block: 4096   directory
Device: 802h/2050d      Inode: 278059      Links: 3
Access: (0755/drwxr-xr-x)  Uid: ( 100/     root)   Gid: (    0/    root)
Access: 2012-02-09 16:01:58.000000000 +0800
Modify: 2010-04-28 16:29:37.000000000 +0800
Change: 2010-04-28 16:29:37.000000000 +0800

>stat -c %n test
test

>stat -c %y test
2010-04-28 16:29:37.000000000 +0800

>stat * | grep File | awk '{print $2}'
`diag'

>stat test | grep Modify  | awk '{print $2 $3}'  | cut -d"." -f1  | sed -e 's/-//g' -e 's/://g'
20100428162937

你可能感兴趣的:(命令)