Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the directory /dev/pts I see 3 pts instances as shown in the screenshot below however when I run the command w I only see 1 instance of pts. Why is that?


enter image description here


enter image description here

share|improve this question
up vote 1 down vote accepted

w does not deal with tty devices directly – it only displays those registered in /run/utmp. Programs (such as terminal emulators, or remote login daemons) usually register themselves to become visible in the w/who list, but are not required in any way to do so.

For example, the screen utility deregisters itself when you detach, despite keeping the pty devices allocated. A popular replacement of screen, tmux, never uses utmp – it isn't programmed to use it. Some terminal emulators do not register themselves simply due to lack of privileges (the program needs to have "setgid utmp" set). There could be more reasons, and not all of them malicious.

Use lsof or fuser to see all processes having those ptys open:

sudo fuser -v /dev/pts/*

sudo lsof /dev/pts/*
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .