I am wondering what the type c is in the ls command.
I was following the symlinks at /dev/stdin and ended up with /dev/pts/0
$ ls -l /dev/pts/0
crw--w---- 1 blue tty 136, 0 Apr 8 21:50 /dev/pts/0
I can see the first symbol in the mode output is a c
. Now I am trying to find out what this means.
I could find some information but c is not listed and some of them seem also a bit wrong. At least on my box a symlink has a lowercase l, not an uppercase L.
d if the entry is a directory;
a if the entry is an append-only file;
D if the entry is a Unix device;
L if the entry is a symbolic link;
P if the entry is a named pipe;
S if the entry is a socket;
- if the entry is a plain file.
source: http://manpages.ubuntu.com/manpages/jammy/en/man1/ls.1plan9.html
I can read in man pts
that these are pseudo terminal master slave pairs.
ptmx, pts - pseudoterminal master and slave
When a process opens /dev/ptmx, it gets a file descriptor for a pseudoterminal master and a pseudoterminal slave device is created in the /dev/pts directory. Each file descriptor obtained by opening /dev/ptmx is an independent pseudoterminal master with its own associated slave, whose path can be found by passing the file descriptor to ptsname(3).
So what does the c
stand for? I assume it means this is a pseudoterminal slave device
.
Edit:
After reading and thinking more about it, I guess its c
because its essentially a console.
man ls
on your own system. – Kusalananda Apr 08 '22 at 20:20man ls
on my system doesnt say anything about that at all. It has no description of the different types. – The Fool Apr 08 '22 at 20:20