标签:3.1 文件的时间 修改时间 more gid mtime lin 访问时间 cal
linux文件管理相关的命令文件元数据的查看(文件自身的属性)
stat: 获取指定文件的元数据
$ stat test
File: `test‘
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 802h/2050d Inode: 651942 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 500/ centos) Gid: ( 500/ centos)
Access: 2018-08-03 21:57:38.527860605 -0700
Modify: 2018-08-03 21:57:38.527860605 -0700
Change: 2018-08-03 21:57:38.527860605 -0700
file: 文件内容类型查看命令
file /PATH/TO/SOMEWHERE
```
$ file test.txt
test.txt: ASCII text
```
文本文件查看命令
cat [OPTION]...[FILE]...: 链接并显示文本文件
[centos@localhost Downloads]$ cat test.txt
10
9
8
7
6
[centos@localhost Downloads]$ cat test2.txt
5
4
3
2
1
[centos@localhost Downloads]$ cat test.txt test2.txt
10
9
8
7
6
5
4
3
2
1
less [OPTIONS...] FILE
[root@localhost Downloads]# stat -c %x\n test2.txt
2018-08-03 22:26:53.148443735 -0700n
[root@localhost Downloads]# touch -a test2.txt
[root@localhost Downloads]# stat -c %x\n test2.txt
2018-08-04 01:03:40.197146110 -0700n
[root@localhost Downloads]# stat -c %y test2.txt
2018-08-03 22:26:08.781013024 -0700
[root@localhost Downloads]# touch -m test2.txt
[root@localhost Downloads]# stat -c %y test2.txt
2018-08-04 01:07:48.250958279 -0700
[root@localhost Downloads]# stat -c %y test2.txt
2018-08-04 01:09:34.094912552 -0700
[root@localhost Downloads]# touch -mt 201404052330.50 test2.txt
[root@localhost Downloads]# stat -c %y test2.txt
2014-04-05 23:30:50.000000000 -0700
标签:3.1 文件的时间 修改时间 more gid mtime lin 访问时间 cal
原文地址:http://blog.51cto.com/13509526/2154690