LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-04-2005, 11:52 AM   #1
Vgui
Member
 
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, 12:44 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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.
 
  


Reply


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 01:05 AM
pts/0, pts/1 devices ?? nadine.mauch Linux - General 1 10-07-2004 12:00 PM
which pts do I use Luskacik Linux - Newbie 0 09-30-2004 11:07 AM
/dev/pts/0 alaios Linux - Hardware 1 10-15-2003 04:43 PM
what is pts/# Cichlid Linux - General 2 12-28-2002 12:18 AM


All times are GMT -5. The time now is 04:14 PM.

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