Linux 系统下可分为七种类型文件:
1.普通文件;
以 - 符号开头为普通文件;一般由相关应用程序创建,如:cp工具、touch工具等。
[root@cnyouyue ~]# ls -lh install.log
-rw-r–r– 1 root root 53K 10-16 08:54 install.log
2.目录文件;
以 d 字母开头为目录;用命令mkdir、cp 等命令创建。
[root@cnyouyue ~]# ls -lh
drwxr-xr-x 2 root root 4.0K 10-16 10:53 mydir
3.字符设备
用mknode来创建,一般不用手动创建设备文件,因为这些文件和内核相关联的。
以 c 字母开头的为设备文件。比如猫等串口设备。
[root@cnyouyue~]# ls -la /dev/tty
crw-rw-rw- 1 root tty 5, 0 10-16 08:29 /dev/tty
4.块设备文件
以 b 字母开头的为块设备,如硬盘,光驱等设备。
[root@cnyouyue ~]# ls -la /dev/sda1
brw-r—– 1 root disk 3, 1 2022-10-16 /dev/sda1
5.套接口文件;
以 s 字母开头的,这个知道有这个东西就行
6 符号链接文件;
以 l 字符开头,
[root@cnyouyue ~]# ls -lh start.log
lrwxrwxrwx 1 root root 11 04-19 11:18 start.log -> install.log
7 管道文件 p (pipe)
以p字符开头