"ls -l"コマンドの出力にはいくつかの可能なファイル形式がありますか?

通常、出力コマンドで利用可能なファイルタイプは、それぞれディレクトリと一般ファイルを表すものls -lです。d-

それに加えて、lmacOSの出力には別の種類があります。

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出力コマンドにはいくつかの可能なファイル形式がありますか?

ベストアンサー1

報告されるファイル形式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では(FreeBSDも同じです。a除く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.

おすすめ記事