文件类型
类型 | 解释 |
---|---|
d | 目录 |
– | 普通文件和命令 |
c | 字符串设备(键盘、鼠标之类) |
b | 块设备(光驱、磁盘之类) |
s | 通信 |
l | 软链接文件 |
权限里的第一位,是文件类型
[root@evan-01 /]# ls -la
总用量 24
dr-xr-xr-x. 20 root root 281 7月 27 2018 .
dr-xr-xr-x. 20 root root 281 7月 27 2018 ..
-rw-r--r-- 1 root root 0 7月 12 2018 .autorelabel
lrwxrwxrwx. 1 root root 7 5月 28 2018 bin -> usr/bin
dr-xr-xr-x. 4 root root 4096 5月 28 2018 boot
drwxr-xr-x 5 root root 62 8月 28 2018 data
drwxr-xr-x 20 root root 3360 8月 7 14:44 dev
drwxr-xr-x. 93 root root 8192 8月 7 14:44 etc
drwxr-xr-x. 13 root root 162 9月 14 2018 home
lrwxrwxrwx. 1 root root 7 5月 28 2018 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 5月 28 2018 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 11月 5 2016 media
drwxr-xr-x. 2 root root 6 11月 5 2016 mnt
drwxr-xr-x. 2 root root 6 11月 5 2016 opt
dr-xr-xr-x 199 root root 0 8月 7 14:43 proc
dr-xr-x---. 20 root root 4096 1月 16 2019 root
drwxr-xr-x 26 root root 860 8月 7 14:45 run
lrwxrwxrwx. 1 root root 8 5月 28 2018 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 11月 5 2016 srv
dr-xr-xr-x 13 root root 0 8月 7 14:44 sys
drwxr-xr-x. 2 root root 19 6月 25 2018 test
drwxr-xr-x 2 root root 33 7月 18 2018 test2
drwxrwxrwt 8 root root 220 8月 7 14:48 tmp
drwxr-xr-x. 13 root root 155 5月 28 2018 usr
drwxr-xr-x. 21 root root 4096 8月 7 14:44 var
[root@evan-01 /]#
cat 查看普通文件
普通文本文档可以用cat命令查看,绿色文件(二进制文件)是被编译过的文件,无法查看,类似的还有.exe文件都是无法查看的
[root@evan-01 ~]# touch test.txt
[root@evan-01 ~]# echo "this is a test" > test.txt
[root@evan-01 ~]# cat test.txt
this is a test
[root@evan-01 ~]#