When I type the command:
[root@degeneration Desktop]# who am i root pts/0 2013-04-12 15:08 (:0.0)
What is pts/0 and what is meant by (:0.0)?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
pts/0 is telling you which "pseudo terminal" the user is logged in on. In this case it's terminal #0. The "(:0.0)" tells you which hostname and display you're using.
The output can definitely be confusing to a Unix novice.
-mis same as
[root@grinch]$ who am i root pts/4 2013-04-12 07:10 (greeneggs.mydom.net) [root@grinch]$ who -m root pts/4 2013-04-12 07:10 (greeneggs.mydom.net)
[sam@munger ~]$ who am i sam pts/0 2013-04-12 07:19 (192.168.1.7)
[saml@greeneggs ~]$ who am i saml pts/1 2013-04-11 16:41 (:0.0)
The last bit that still might be confusing you is the
:0.0. This is how X Windows represents the "display" a user is on. The first "0" says which monitor/device you're on, the second "0" says which virtual display you're on.
This harks back to the days when computers were expensive and so multiple people might be working on the same computer all at the same time. I wouldn't worry about it, just remember that it's either going to be ":0.0" or possibly ":0". The environment variable "DISPLAY" and the command
xhost make use of the ":0.0" value.
You can read more about remote displaying in Unix here.
who am i
Aren't they the same command? No they're different:
[saml@grinchy ~]$ ls -l /usr/bin/who /usr/bin/whoami -rwxr-xr-x 1 root root 49432 Nov 3 2010 /usr/bin/who -rwxr-xr-x 1 root root 26280 Nov 3 2010 /usr/bin/whoami
Also their output is completely different;
whoami just shows you your effective userid while
who am i shows you connection info about your terminal:
[saml@grinchy ~]$ who am i saml pts/0 2013-04-11 16:41 (:0.0) [saml@grinchy ~]$ whoami saml
whoami man page here.
Quoting from here.
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".
you will find pts/0 listed in
who output if there is a remote connection to ssh:
I am one and the only on my machine:
$ who me :0 2015-02-02 14:06 (:0) me pts/7 2015-02-02 14:07 (:0) me pts/12 2015-02-02 14:07 (:0)
I am connected from other machine to ssh server, so I have opened remote terminal:
$ who me :0 2015-02-02 14:06 (:0) me pts/7 2015-02-02 14:07 (:0) me pts/12 2015-02-02 14:07 (:0) me pts/0 2015-02-02 14:31 (x.server.something.com)