 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

2nd June 2012, 09:56 PM
|
|
Registered User
|
|
Join Date: May 2012
Location: Aspen
Posts: 48

|
|
|
who command
I have a question about the who command.
When I type who
The output of my terminal is
username tty1 2012-06-02 06:25 (:0)
username pts/0 2012-06-02 13:41 (:0)
My question is what is pts/0 and what is ttyl? Also, what is the (:0) at the end? Also, I am the only user on this machine, and while both lines list my non-root name, it lists it twice as though 2 people have been on. It also says 2 users when I type in uptime. This is what uptime returns.
@localhost Begshell]$ uptime
13:57:53 up 10:41, 2 users, load average: 1.52, 1.26, 0.95
Thanks!!
Last edited by Socrates440; 2nd June 2012 at 09:59 PM.
|

2nd June 2012, 10:11 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
Re: who command
Your tty1 is your initial log-in to your desktop session.
Your pts/0 is you "logon" to a terminal console (when you opened gnome-terminal, or Terminal, Konsole, or whichever terminal you're using. Open a second terminal and give the "who" command again.... you'll see another pts/n logon with your username.
|

2nd June 2012, 11:38 PM
|
|
Registered User
|
|
Join Date: May 2011
Posts: 700

|
|
|
Re: who command
And the :0 is I guess the X server display in use.
|

3rd June 2012, 12:22 AM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,711

|
|
|
Re: who command
The virtual consoles (accessible with Ctrl+Alt+F1–6) are named "tty1"–6, and one is used by the graphical desktop (more if you use fast-user-switching).
All text terminal emulators (and some other programs like screen and ssh) create pseudo-terminal devices (called "pts/0"–...).
All X (graphical) sessions are named ":0"–... (more fully host:display.screen; where host is a hostname or IP address, defaulting to localhost; display is the session number, unique to the current virtual console; and screen is the monitor, defaulting to the first or only monitor).
|

3rd June 2012, 01:31 AM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,107

|
|
|
Re: who command
Quote:
Originally Posted by Gareth Jones
...
All text terminal emulators (and some other programs like screen and ssh) create pseudo-terminal devices (called "pts/0"–...).
|
pts/0 pts/1 pts/2... the number identifies which pseudoterminal is in use.
Quote:
|
All X (graphical) sessions are named ":0"–... (more fully host:display.screen; where host is a hostname or IP address, defaulting to localhost; display is the session number, unique to the current virtual console; and screen is the monitor, defaulting to the first or only monitor).
|
Mostly, but not quite. The display number is assigned by the method used by the X server startup. In my case there are two users logged in - the first one gets :0.0, but the second one gets :14.0... at least this time. If you use the startx method to start an X server then you specify the display number, and it can be any value as long as it isn't already used. What happens is that a new domain socket gets created in /tmp/.X11-unix with the "X<displaynumber>" for the name. It is this socket that is used by all applications to initiate communication with the X server. After the authentication step is completed it is possible that the X server pass a shared memory region back to the application for mass data transfer (if it is running on the same system as the X server).
When the display is handled by sshd, then all connections are TCP connection over the port 6000+displaynumber+offset, where "offset" is usually, but not always 10. In this case it is not possible to have shared memory (at least not handled by sshd...) to pass large blocks of data to/from the X server.
|

3rd June 2012, 06:41 PM
|
|
Registered User
|
|
Join Date: May 2012
Location: Aspen
Posts: 48

|
|
|
Re: who command
Thanks! Is that why uptime shows 2 users? The desktop session and the terminal session?
|

3rd June 2012, 08:43 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,107

|
|
|
Re: who command
yes.
You can verify that by just starting another terminal session - you will see 3 users.
Note: adding a user is not a function of pseudoterminals. The program that does that updates the utmp/wtmp entry that says a new login is present, and uses a pty for the interface. It is entirely possible to modify that such that users are not added.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 15:28 (Friday, 24-05-2013)
|
|
 |
 |
 |
 |
|
|