Fedora Linux Support Community & Resources Center
  #1  
Old 2nd June 2012, 10:56 PM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
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 10:59 PM.
Reply With Quote
  #2  
Old 2nd June 2012, 11:11 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 6,199
linuxchrome
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.
Reply With Quote
  #3  
Old 3rd June 2012, 12:38 AM
secipolla Offline
Registered User
 
Join Date: May 2011
Posts: 700
linuxfirefox
Re: who command

And the :0 is I guess the X server display in use.
Reply With Quote
  #4  
Old 3rd June 2012, 01:22 AM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 32
Posts: 2,771
linuxfirefox
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).
Reply With Quote
  #5  
Old 3rd June 2012, 02:31 AM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,878
linuxfirefox
Re: who command

Quote:
Originally Posted by Gareth Jones View Post
...

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.
Reply With Quote
  #6  
Old 3rd June 2012, 07:41 PM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
Re: who command

Thanks! Is that why uptime shows 2 users? The desktop session and the terminal session?
Reply With Quote
  #7  
Old 3rd June 2012, 09:43 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,878
linuxfirefox
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.
Reply With Quote
Reply

Tags
command

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java jre1.6.0_97 Export Command Line Command richm8027 Using Fedora 23 7th September 2008 09:04 AM


Current GMT-time: 20:33 (Friday, 28-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Polla - Snyder, Texas Instagram Photos - Pub Underground Photos on Instagram - Al Hoceima Photos