Linux中文件一共有7大类型,分别是:
- 普通文件 d 目录文件 l 软链接 b 块设备文件,如硬盘,光驱等 p 管道文件 c 字符设备文件,如猫等串口设备 s 套接字文件,如mysql.sock等
演示示例:
[root@iflytek ~]# ll file1 -rw-rw-rw- 1 nginx nginx 10 Oct 5 20:27 file1 #普通文件 [root@iflytek ~]# ll -d Music/ drwxr-xr-x. 2 root root 6 Jul 16 16:39 Music/ #目录文件 [root@iflytek ~]# ll l_file1 lrwxrwxrwx 1 root root 5 Oct 5 21:05 l_file1 -> file1 #软链接 [root@iflytek ~]# ll /dev/sda brw-rw---- 1 root disk 8, 0 Oct 5 14:47 /dev/sda #块设备文件 [root@iflytek ~]# ll p_file prw-r--r-- 1 root root 0 Oct 5 21:08 p_file #管道文件 [root@iflytek ~]# ll /dev/vcs crw-rw---- 1 root tty 7, 0 Oct 5 14:47 vcs #字符设备文件 [root@iflytek ~]# ll /usr/local/mysql/data/mysql.sock srwxrwxrwx 1 mysql mysql 0 Oct 5 17:30 /usr/local/mysql/data/mysql.sock #套接字文件 [root@iflytek ~]#



