usually, the possible file types in the output ls -l
command are d
and -
, which represent directory and regular file respectively.
besides above, I saw another type l
in the output on 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 -> /
So, How many possible file types in the output ls -l
command?
Best Answer
The filetypes reported by
ls
depends on the capabilities of the underlying filesystem, the operating system, and on the specific implementation ofls
.The
l
type is the common symbolic link file type.This is (ought to be) documented in your
ls
manual.On OpenBSD (macOS and AIX has the same list, but in another order):
On NetBSD (FreeBSD has the same without
a
andA
):From
info ls
(i.e. the GNUls
manual):On Solaris 11: