Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-04-2005, 10:52 AM   #1
Registered: Apr 2005
Location: Canada
Distribution: Slackware
Posts: 496

Rep: Reputation: 31
Users on pts/# ?

I'm sure this is a commonly known answer, but what exactly is pts/1, pts/2, etc.? I'm wondering as I sometimes use the "who" command, and it gives me a few login names on the pts (normally the user I am logged in with). I've started using rxvt instead of aterm, does that have anything to do with it? Thanks for any help.
Old 10-04-2005, 11:44 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,936
Blog Entries: 14

Rep: Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160
These are "pseudo-ttys" or for short hand "ptys".

Back in the days of serial connection where you'd have hardwired terminals to serial connections on the server they were called "teletypes" or (real) "ttys" for short. With the advent of networking one still needed a way to relate a terminal session to the established connection. However since this connection was no longer hardwired it wouldn't always be the same. This connection appears on a "pty" now. Note that someone on pts/1 today might be on pts/2 tomorrow if he is the second one to login tomorrow but was first today.

Its just a shorthand way of tracking the connection and is generally used as its input (stdin) and output (stdout) device. It is good for checking processes by a given connection if a user is logged in on two different one. Also it is even good for tracking all the processes for a given session if the user has switched user (done su). Have a look at shell (bash, ksh, csh or other) man pages for a discussion of stdin/stdout and other file descriptors.

Doing "ps -ft pts/#" for a given number will show you all processes for the specified pty.

Also notice that on some processes rather than a tty or pty you'll see a "?" in the tty field of ps -ef. These are processes that are backgrounded so aren't associated with a terminal at all. Their stdout is usually something like a log file or a /dev/null to just not keep it.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Normal users can't open /dev/pts/x wartstew Debian 2 10-03-2005 12:05 AM
pts/0, pts/1 devices ?? nadine.mauch Linux - General 1 10-07-2004 11:00 AM
which pts do I use Luskacik Linux - Newbie 0 09-30-2004 10:07 AM
/dev/pts/0 alaios Linux - Hardware 1 10-15-2003 03:43 PM
what is pts/# Cichlid Linux - General 2 12-27-2002 11:18 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration