输出`ls -l`命令中有几种可能的文件类型?

n

通常,输出ls -l命令中可能的文件类型d-,分别代表目录和常规文件。

除上述以外,我l在macOS的输出中看到了另一种类型

drwxr-xr-x   8 yongjia  staff    256 Aug 31 06:58 .
drwxr-xr-x   4 yongjia  staff    128 Aug 30 11:31 ..
lrwxr-xr-x   1 root     wheel      1 Aug 17 07:25 Macintosh HD -> /

那么,输出ls -l命令中有几种可能的文件类型

库萨兰达

报告的文件类型ls取决于基础文件系统,操作系统的功能以及的特定实现ls

l类型是常见的符号链接文件类型。

(应该)记录在您的ls手册中。

在OpenBSD上(macOS和AIX具有相同的列表,但顺序不同):

-     regular file
b     block special file
c     character special file
d     directory
l     symbolic link
p     FIFO
s     socket link

在NetBSD上(不带a和的FreeBSD相同A):

-     Regular file.
a     Archive state 1.
A     Archive state 2.
b     Block special file.
c     Character special file.
d     Directory.
l     Symbolic link.
p     FIFO.
s     Socket link.
w     Whiteout.

info ls(即GNUls手册):

‘-’
     regular file
‘b’
     block special file
‘c’
     character special file
‘C’
     high performance (“contiguous data”) file
‘d’
     directory
‘D’
     door (Solaris 2.5 and up)
‘l’
     symbolic link
‘M’
     off-line (“migrated”) file (Cray DMF)
‘n’
     network special file (HP-UX)
‘p’
     FIFO (named pipe)
‘P’
     port (Solaris 10 and up)
‘s’
     socket
‘?’
     some other file type

在Solaris 11上:

d
The entry is a directory.

D
The entry is a door.

l
The entry is a symbolic link.

b
The entry is a block special file.

c
The entry is a character special file.

p
The entry is a FIFO (or “named pipe”) special file.

P
The entry is an event port.

s
The entry is an AF_UNIX address family socket.

-
The entry is an ordinary file.

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章