linux文件类型以及ls命令介绍

简介:

ls -l列出linux的文件类型,常用的文件类型有:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[root@openstack dev] # ls -l
总用量 0
crw-rw----. 1 root video    10, 175 11月 16 22:03 agpgart
crw-------. 1 root root     10, 235 11月 16 22:03 autofs
drwxr-xr-x. 2 root root         180 11月 16 22:02 block
drwxr-xr-x. 2 root root          80 11月 16 22:02 bsg
crw-------. 1 root root     10, 234 11月 16 22:02 btrfs-control
drwxr-xr-x. 3 root root          60 11月 16 22:02 bus
lrwxrwxrwx. 1 root root           3 11月 16 22:03 cdrom -> sr0
drwxr-xr-x. 2 root root          80 11月 16 22:02 centos_openstack
drwxr-xr-x. 2 root root        2920 11月 16 22:03 char
crw-------. 1 root root      5,   1 11月 16 22:03 console
lrwxrwxrwx. 1 root root          11 11月 16 22:02 core ->  /proc/kcore
drwxr-xr-x. 4 root root         100 11月 16 22:02 cpu
crw-------. 1 root root     10,  61 11月 16 22:03 cpu_dma_latency
crw-------. 1 root root     10,  62 11月 16 22:03 crash
drwxr-xr-x. 5 root root         100 11月 16 22:02 disk
brw-rw----. 1 root disk    253,   0 11月 16 22:03 dm-0
brw-rw----. 1 root disk    253,   1 11月 16 22:03 dm-1
drwxr-xr-x. 2 root root          80 11月 16 22:02 dri
crw-rw----. 1 root video    29,   0 11月 16 22:03 fb0
lrwxrwxrwx. 1 root root          13 11月 16 22:02 fd ->  /proc/self/fd
brw-rw----. 1 root disk      2,   0 11月 16 22:03 fd0
crw-rw-rw-. 1 root root      1,   7 11月 16 22:03 full
crw-rw-rw-. 1 root root     10, 229 11月 16 22:02 fuse
crw-------. 1 root root    248,   0 11月 16 22:03 hidraw0
crw-------. 1 root root     10, 228 11月 16 22:03 hpet
drwxr-xr-x. 2 root root           0 11月 16 22:02 hugepages
crw-------. 1 root root     10, 183 11月 16 22:03 hwrng
lrwxrwxrwx. 1 root root          25 11月 16 22:02 initctl ->  /run/systemd/initctl/fifo
drwxr-xr-x. 4 root root         300 11月 16 22:03 input
crw-r--r--. 1 root root      1,  11 11月 16 22:03 kmsg
srw-rw-rw-. 1 root root           0 11月 16 22:02 log
crw-rw----. 1 root disk     10, 237 11月 16 22:02 loop-control
drwxr-xr-x. 2 root root         100 11月 16 22:02 mapper
crw-------. 1 root root     10, 227 11月 16 22:03 mcelog
crw-r-----. 1 root kmem      1,   1 11月 16 22:03 mem
drwxrwxrwt. 2 root root          40 11月 16 22:02 mqueue
drwxr-xr-x. 2 root root          60 11月 16 22:02 net
crw-------. 1 root root     10,  60 11月 16 22:03 network_latency
crw-------. 1 root root     10,  59 11月 16 22:03 network_throughput
crw-rw-rw-. 1 root root      1,   3 11月 16 22:03 null
crw-------. 1 root root     10, 144 11月 16 22:03 nvram
crw-------. 1 root root      1,  12 11月 16 22:03 oldmem
crw-r-----. 1 root kmem      1,   4 11月 16 22:03 port
crw-------. 1 root root    108,   0 11月 16 22:02 ppp
crw-rw-rw-. 1 root  tty        5,   2 11月 16 22:34 ptmx
drwxr-xr-x. 2 root root           0 11月 16 22:02 pts
crw-rw-rw-. 1 root root      1,   8 11月 16 22:03 random
drwxr-xr-x. 2 root root          60 11月 16 22:02 raw
crw-rw-r--. 1 root root     10,  57 11月 16 22:03 rfkill
lrwxrwxrwx. 1 root root           4 11月 16 22:03 rtc -> rtc0
crw-------. 1 root root    253,   0 11月 16 22:03 rtc0
brw-rw----. 1 root disk      8,   0 11月 16 22:03 sda
brw-rw----. 1 root disk      8,   1 11月 16 22:03 sda1
brw-rw----. 1 root disk      8,   2 11月 16 22:03 sda2
crw-rw----. 1 root cdrom    21,   0 11月 16 22:03 sg0
crw-rw----. 1 root disk     21,   1 11月 16 22:03 sg1
drwxrwxrwt. 2 root root          40 11月 16 22:02 shm
crw-------. 1 root root     10, 231 11月 16 22:03 snapshot
drwxr-xr-x. 2 root root          80 11月 16 22:02 snd
brw-rw----. 1 root cdrom    11,   0 11月 16 22:03 sr0
lrwxrwxrwx. 1 root root          15 11月 16 22:02 stderr ->  /proc/self/fd/2
lrwxrwxrwx. 1 root root          15 11月 16 22:02 stdin ->  /proc/self/fd/0
lrwxrwxrwx. 1 root root          15 11月 16 22:02 stdout ->  /proc/self/fd/1
crw-rw-rw-. 1 root  tty        5,   0 11月 16 22:03  tty
crw--w----. 1 root  tty        4,   0 11月 16 22:03 tty0
crw--w----. 1 root  tty        4,   1 11月 16 22:03 tty1
crw--w----. 1 root  tty        4,  10 11月 16 22:03 tty10
crw--w----. 1 root  tty        4,  11 11月 16 22:03 tty11
crw--w----. 1 root  tty        4,  12 11月 16 22:03 tty12
crw--w----. 1 root  tty        4,  13 11月 16 22:03 tty13
crw--w----. 1 root  tty        4,  14 11月 16 22:03 tty14
crw--w----. 1 root  tty        4,  15 11月 16 22:03 tty15
crw--w----. 1 root  tty        4,  16 11月 16 22:03 tty16
crw--w----. 1 root  tty        4,  17 11月 16 22:03 tty17
crw--w----. 1 root  tty        4,  18 11月 16 22:03 tty18
crw--w----. 1 root  tty        4,  19 11月 16 22:03 tty19
crw--w----. 1 root  tty        4,   2 11月 16 22:03 tty2
crw--w----. 1 root  tty        4,  20 11月 16 22:03 tty20
crw--w----. 1 root  tty        4,  21 11月 16 22:03 tty21
crw--w----. 1 root  tty        4,  22 11月 16 22:03 tty22
crw--w----. 1 root  tty        4,  23 11月 16 22:03 tty23
crw--w----. 1 root  tty        4,  24 11月 16 22:03 tty24
crw--w----. 1 root  tty        4,  25 11月 16 22:03 tty25
crw--w----. 1 root  tty        4,  26 11月 16 22:03 tty26
crw--w----. 1 root  tty        4,  27 11月 16 22:03 tty27
crw--w----. 1 root  tty        4,  28 11月 16 22:03 tty28
crw--w----. 1 root  tty        4,  29 11月 16 22:03 tty29
crw--w----. 1 root  tty        4,   3 11月 16 22:03 tty3
crw--w----. 1 root  tty        4,  30 11月 16 22:03 tty30
crw--w----. 1 root  tty        4,  31 11月 16 22:03 tty31
crw--w----. 1 root  tty        4,  32 11月 16 22:03 tty32
crw--w----. 1 root  tty        4,  33 11月 16 22:03 tty33
crw--w----. 1 root  tty        4,  34 11月 16 22:03 tty34
crw--w----. 1 root  tty        4,  35 11月 16 22:03 tty35
crw--w----. 1 root  tty        4,  36 11月 16 22:03 tty36
crw--w----. 1 root  tty        4,  37 11月 16 22:03 tty37
crw--w----. 1 root  tty        4,  38 11月 16 22:03 tty38
crw--w----. 1 root  tty        4,  39 11月 16 22:03 tty39
crw--w----. 1 root  tty        4,   4 11月 16 22:03 tty4
crw--w----. 1 root  tty        4,  40 11月 16 22:03 tty40
crw--w----. 1 root  tty        4,  41 11月 16 22:03 tty41
crw--w----. 1 root  tty        4,  42 11月 16 22:03 tty42
crw--w----. 1 root  tty        4,  43 11月 16 22:03 tty43
crw--w----. 1 root  tty        4,  44 11月 16 22:03 tty44
crw--w----. 1 root  tty        4,  45 11月 16 22:03 tty45
crw--w----. 1 root  tty        4,  46 11月 16 22:03 tty46
crw--w----. 1 root  tty        4,  47 11月 16 22:03 tty47
crw--w----. 1 root  tty        4,  48 11月 16 22:03 tty48
crw--w----. 1 root  tty        4,  49 11月 16 22:03 tty49
crw--w----. 1 root  tty        4,   5 11月 16 22:03 tty5
crw--w----. 1 root  tty        4,  50 11月 16 22:03 tty50
crw--w----. 1 root  tty        4,  51 11月 16 22:03 tty51
crw--w----. 1 root  tty        4,  52 11月 16 22:03 tty52
crw--w----. 1 root  tty        4,  53 11月 16 22:03 tty53
crw--w----. 1 root  tty        4,  54 11月 16 22:03 tty54
crw--w----. 1 root  tty        4,  55 11月 16 22:03 tty55
crw--w----. 1 root  tty        4,  56 11月 16 22:03 tty56
crw--w----. 1 root  tty        4,  57 11月 16 22:03 tty57
crw--w----. 1 root  tty        4,  58 11月 16 22:03 tty58
crw--w----. 1 root  tty        4,  59 11月 16 22:03 tty59
crw--w----. 1 root  tty        4,   6 11月 16 22:03 tty6
crw--w----. 1 root  tty        4,  60 11月 16 22:03 tty60
crw--w----. 1 root  tty        4,  61 11月 16 22:03 tty61
crw--w----. 1 root  tty        4,  62 11月 16 22:03 tty62
crw--w----. 1 root  tty        4,  63 11月 16 22:03 tty63
crw--w----. 1 root  tty        4,   7 11月 16 22:03 tty7
crw--w----. 1 root  tty        4,   8 11月 16 22:03 tty8
crw--w----. 1 root  tty        4,   9 11月 16 22:03 tty9
crw-rw----. 1 root dialout   4,  64 11月 16 22:03 ttyS0
crw-rw----. 1 root dialout   4,  65 11月 16 22:03 ttyS1
crw-rw----. 1 root dialout   4,  66 11月 16 22:03 ttyS2
crw-rw----. 1 root dialout   4,  67 11月 16 22:03 ttyS3
crw-------. 1 root root     10, 239 11月 16 22:02 uhid
crw-------. 1 root root     10, 223 11月 16 22:02 uinput
crw-rw-rw-. 1 root root      1,   9 11月 16 22:03 urandom
crw-------. 1 root root    249,   0 11月 16 22:03 usbmon0
crw-------. 1 root root    249,   1 11月 16 22:03 usbmon1
crw-------. 1 root root    249,   2 11月 16 22:03 usbmon2
crw-rw----. 1 root  tty        7,   0 11月 16 22:03 vcs
crw-rw----. 1 root  tty        7,   1 11月 16 22:03 vcs1
crw-rw----. 1 root  tty        7,   2 11月 16 22:03 vcs2
crw-rw----. 1 root  tty        7,   3 11月 16 22:03 vcs3
crw-rw----. 1 root  tty        7,   4 11月 16 22:03 vcs4
crw-rw----. 1 root  tty        7,   5 11月 16 22:03 vcs5
crw-rw----. 1 root  tty        7,   6 11月 16 22:03 vcs6
crw-rw----. 1 root  tty        7, 128 11月 16 22:03 vcsa
crw-rw----. 1 root  tty        7, 129 11月 16 22:03 vcsa1
crw-rw----. 1 root  tty        7, 130 11月 16 22:03 vcsa2
crw-rw----. 1 root  tty        7, 131 11月 16 22:03 vcsa3
crw-rw----. 1 root  tty        7, 132 11月 16 22:03 vcsa4
crw-rw----. 1 root  tty        7, 133 11月 16 22:03 vcsa5
crw-rw----. 1 root  tty        7, 134 11月 16 22:03 vcsa6
drwxr-xr-x. 2 root root          60 11月 16 22:02 vfio
crw-------. 1 root root     10,  63 11月 16 22:03 vga_arbiter
crw-------. 1 root root     10, 137 11月 16 22:02 vhci
crw-------. 1 root root     10, 238 11月 16 22:02 vhost-net
crw-------. 1 root root     10,  58 11月 16 22:03 vmci
crw-------. 1 root root     10,  56 11月 16 22:03 vsock
crw-rw-rw-. 1 root root      1,   5 11月 16 22:03 zero
[root@openstack dev] #

其中:

     -:表示普通文件

    d:表示目录文件

     l:表示符号链接文件(软链接)

    c:表示字符设备文件

    b:块设备文件

    s:套接字文件socket

    p:命令管道文件pipe


ls命令选项:

   -h 人性化显示结果,如做文件大小单位换算

   -d显示目录自身属性

   -i 显示inode(index node),即文件唯一编号

   -r逆序显示

   -t按照时间顺序显示

   -R递归(recursive)显示



















本文转自lq201151CTO博客,原文链接: http://blog.51cto.com/liuqun/1982640,如需转载请自行联系原作者



相关文章
|
8天前
|
Linux
Linux系统之whereis命令的基本使用
Linux系统之whereis命令的基本使用
50 23
Linux系统之whereis命令的基本使用
|
21天前
|
网络协议 Unix Linux
深入解析:Linux网络配置工具ifconfig与ip命令的全面对比
虽然 `ifconfig`作为一个经典的网络配置工具,简单易用,但其功能已经不能满足现代网络配置的需求。相比之下,`ip`命令不仅功能全面,而且提供了一致且简洁的语法,适用于各种网络配置场景。因此,在实际使用中,推荐逐步过渡到 `ip`命令,以更好地适应现代网络管理需求。
34 11
|
2月前
|
Linux Shell
Linux 10 个“who”命令示例
Linux 10 个“who”命令示例
100 14
Linux 10 个“who”命令示例
|
2月前
|
Ubuntu Linux
Linux 各发行版安装 ping 命令指南
如何在不同 Linux 发行版(Ubuntu/Debian、CentOS/RHEL/Fedora、Arch Linux、openSUSE、Alpine Linux)上安装 `ping` 命令,详细列出各发行版的安装步骤和验证方法,帮助系统管理员和网络工程师快速排查网络问题。
205 20
|
2月前
|
Linux
linux查看目录下的文件夹命令,find查找某个目录,但是不包括这个目录本身?
通过本文的介绍,您应该对如何在 Linux 系统中查看目录下的文件夹以及使用 `find` 命令查找特定目录内容并排除该目录本身有了清晰的理解。掌握这些命令和技巧,可以大大提高日常文件管理和查找操作的效率。 在实际应用中,灵活使用这些命令和参数,可以帮助您快速定位和管理文件和目录,满足各种复杂的文件系统操作需求。
143 8
|
2月前
|
网络协议 Linux 应用服务中间件
kali的常用命令汇总Linux
kali的常用命令汇总linux
129 7
|
3月前
|
监控 网络协议 Linux
Linux netstat 命令详解
Linux netstat 命令详解
|
3月前
|
Linux 网络安全 数据安全/隐私保护
Linux 超级强大的十六进制 dump 工具:XXD 命令,我教你应该如何使用!
在 Linux 系统中,xxd 命令是一个强大的十六进制 dump 工具,可以将文件或数据以十六进制和 ASCII 字符形式显示,帮助用户深入了解和分析数据。本文详细介绍了 xxd 命令的基本用法、高级功能及实际应用案例,包括查看文件内容、指定输出格式、写入文件、数据比较、数据提取、数据转换和数据加密解密等。通过掌握这些技巧,用户可以更高效地处理各种数据问题。
344 8