0

The command w said

 02:50:35 up 20:54, 10 users,  load average: 1,07, 1,29, 1,41
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
myuser :0       -                lun05   ?xdm?   1:38m  0.11s /bin/sh /etc/xdg/xfce4/xinitrc
myuser pts/0    -                02:06   31:29   2:45   7:35  /usr/bin/xfce4-terminal
myuser pts/1    -                02:48    1:35   0.16s  0.16s bash
myuser pts/2    -                02:48    3.00s  0.05s  0.00s w
myuser pts/3    -                02:49    0.00s  0.00s  7:35  /usr/bin/xfce4-terminal
myuser pts/5    -                02:24    0.00s  0.00s  7:35  /usr/bin/xfce4-terminal
myuser pts/7    -                01:13    0.00s  0.00s  7:35  /usr/bin/xfce4-terminal
myuser pts/8    -                01:33    0.00s  0.00s  7:35  /usr/bin/xfce4-terminal
myuser pts/9    -                01:31    0.00s  0.00s  7:35  /usr/bin/xfce4-terminal
myuser pts/10   -                18:20    0.00s  0.00s  7:35  /usr/bin/xfce4-terminal

The command who output is identical

But the pts oper are only 4

find /dev/pts/
/dev/pts/
/dev/pts/3
/dev/pts/2
/dev/pts/1
/dev/pts/0
/dev/pts/ptmx

Why w and who report 10 users and 10 pts opened?

1

This is somewhat difficult to explain but /dev/pts/n are just virtual devices which only serve to move data form the keyboard to the program to standard output and aren't actual files. There will be a new pts spawned for every application you run which is why they sometimes won't match up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.