What does "pts/" in the output of w mean?

When I run w - to see who is logged on and what they are doing, i see this:

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user tty7 :0 08:14 10:32m 44:10 0.50s gnome-session user pts/0 :0.0 09:15 9:30m 0.24s 0.24s /bin/bash user pts/1 :0.0 14:14 4:32m 0.20s 0.20s bash user pts/5 :0.0 18:27 9:24 0.28s 0.28s bash user pts/7 :0.0 18:35 9:57 0.40s 0.40s bash user pts/8 :0.0 18:37 0.00s 0.22s 0.00s w

What are the pts/ ?

2 Answers

Pseudo-Terminal Slave

Name

ptmx, pts - pseudoterminal master and slave

Description

The file/dev/ptmx is a character file with major number 5 and minor number 2, usually of mode 0666 and owner.group of root.root. It is used to create a pseudoterminal master and slave pair.

When a process opens /dev/ptmx, it gets a file descriptor for a pseudoterminal master (PTM), and a pseudoterminal slave (PTS) device is created in the /dev/pts directory. Each file descriptor obtained by opening /dev/ptmx is an independent PTM with its own associated PTS, whose path can be found by passing the descriptor to ptsname(3).

Before opening the pseudoterminal slave, you must pass the master's file descriptor to grantpt(3) and unlockpt(3).

Once both the pseudoterminal master and slave are open, the slave provides processes with an interface that is identical to that of a real terminal.

Data written to the slave is presented on the master descriptor as input. Data written to the master is presented to the slave as input.

In practice, pseudoterminals are used for implementing terminal emulators such as xterm(1), in which data read from the pseudoterminal master is interpreted by the application in the same way a real terminal would interpret the data, and for implementing remote-login programs such as sshd(8), in which data read from the pseudoterminal master is sent across the network to a client program that is connected to a terminal or terminal emulator.

Pseudoterminals can also be used to send input to programs that normally refuse to read input from pipes (such as su(1), andpasswd(1)).

Source:

They're usually xterminal/gnome-terminal/terminator sessions.

pts/ refers to a pseudo terminal (one that is not a physical terminal), See

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like