why there are 23 files in /dev/pts while only 8 pts are showed using who command?

1.3k views Asked by At

only 8 pts files are used

[root@home tmp]# who
root     pts/2        2012-08-15 18:36 (:pts/1:S.0)
root     pts/6        2012-08-21 16:36 (10.10.11.168)
root     pts/3        2012-08-15 19:24 (:pts/1:S.1)
root     pts/10       2012-08-15 21:04 (:pts/1:S.2)
root     pts/14       2012-08-16 02:41 (:pts/1:S.3)
root     pts/12       2012-08-17 09:14 (:pts/1:S.5)
hugemeow   pts/9        2012-08-21 16:36 (10.10.11.168)
root     pts/22       2012-08-21 22:26 (10.10.11.168)

but there are 23 files in directory /dev/pts/, what's wrong? who used the other 15 files?

[root@home tmp]# ls /dev/pts/ | wc -l
23

[root@home tmp]# ls /dev/pts
0  10  12  14  16  18  2   21  3  5  7  9
1  11  13  15  17  19  20  22  4  6  8

by the way now i am using both screen and tmux to connect to my remote server through ssh clients:)

1

There are 1 answers

2
twalberg On

Not every pty in use corresponds to a login shell, which is what who reports. You may have other windows (xterm,konsole,gnome-terminal,......) open that don't correspond to a new login session (usually created by running login, or by giving specific options to whatever window program you're using).