LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   'who' gives PTS/*... and I don't understand everything (https://www.linuxquestions.org/questions/linux-newbie-8/who-gives-pts-%2A-and-i-dont-understand-everything-716782/)

jonaskellens 04-04-2009 05:52 AM

'who' gives PTS/*... and I don't understand everything
 
Maybe a stupid question and definitely a beginners question :

A CentOS-server, named Asterisk.

Code:

[jonas@asterisk ~]$ who
root    :0          2009-04-01 16:11
root    pts/1        2009-04-01 16:12 (:0.0)
jonas    pts/2        2009-04-01 16:19 (192.168.x.x)

Can someone explain me what this represents ?


Code:

jonas    pts/2        2009-04-01 16:19 (192.168.x.x)
means that I am logged in via ssh... that I know.

Code:

root    :0          2009-04-01 16:11
root    pts/1        2009-04-01 16:12 (:0.0)

I am here logged in as normal user 'jonas' normally, but in a terminal window I am doing yum-updates as 'root' user.

I don't really understand this output though...

I copied this output on Wednesday, april 1 and am looking at it now :-).

I have a GNOME-desktop running, so wouldn't it make more sense that this is represented by "pts/0" ??

AlucardZero 04-04-2009 07:45 AM

pts stands for pseudo terminal slave. A terminal (or console) is traditionally a keyboard/screen combination you sit and type at. Old UNIX boxes would have dozens of them hanging off the back, all
connected with miles of cable. A pseudo terminal provides just the same facility only without the hardware. In other words, it's an xterm window or a konsole window, or whatever utility you use. They pop into life as you ask for them and get given sequential numbers: pts/0, then pts/1 and so on. The physical console is the hardware which is actually attached to your box - you probably only have one. That's labelled ":0" and is refered to as the actual "console".

Copied from this thread

jonaskellens 04-04-2009 10:37 AM

Quote:

Originally Posted by AlucardZero (Post 3498257)
pts stands for pseudo terminal slave. A terminal (or console) is traditionally a keyboard/screen combination you sit and type at. Old UNIX boxes would have dozens of them hanging off the back, all
connected with miles of cable. A pseudo terminal provides just the same facility only without the hardware. In other words, it's an xterm window or a konsole window, or whatever utility you use. They pop into life as you ask for them and get given sequential numbers: pts/0, then pts/1 and so on. The physical console is the hardware which is actually attached to your box - you probably only have one. That's labelled ":0" and is referred to as the actual "console".

Copied from this thread

Thanks for the abstract lesson.

Now concrete... what does this then stands for :

Code:

root    :0          2009-04-01 16:11
root    pts/1        2009-04-01 16:12 (:0.0)

Why is root associated with my physical hardware ":0" ?

Why is root logged in @ pts/1 ? Is this then Gnome ?

Why is there no indication of a pts/0 ??

If pts/1 is a terminal that I opened in Gnome, why is there no pts/0 ??

chrism01 04-04-2009 05:28 PM

Quote:

The term console is rather generic. When accessing a Linux system, there are, in fact, several types of “consoles”, all of which seem to have an administrative aspect.

Physical Console

Virtual Console

Serial Console

System Console

Pseudoterminal or pty
from one of the RH manuals. I'm not going to quote the whole page, for copyright reasons. However, if you google or Wikipedia or read the 'man' pages, it'll become clearer(-ish).
For ptys see:

man pty
man pts
man posix_openpt

jonaskellens 04-05-2009 03:28 AM

I've opened some terminal windows and watched how the pts-number changed. Apparently the count starts with pts/1 because I've closed an earlier terminal session (pts/0).
When opening another terminal window this does not get pts/3 but pts/0.
So I understand now... thanks.


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