Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)?

share|improve this question
add comment

2 Answers

The pts/0 is telling you which "psuedo 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.

who am i is just another way of saying the command who -m. See the man page for who. You can also read about the who command here.

The output can definitely be confusing to a Unix novice.

examples

show's -m is same as am i

[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)

connected to some remote system

[sam@munger ~]$ who am i
sam      pts/0        2013-04-12 07:19 (192.168.1.7)

locally on my laptop

[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 hearkens back to when computers were expensive and so multiple people might be 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.

whoami vs. 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

See the whoami man page here.

share|improve this answer
    
and also ` who am i ` is same as ` whoami `. –  Naai Sekar Apr 12 '13 at 12:42
1  
No it isn't, read the man page! –  slm Apr 12 '13 at 12:44
add comment

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".

share|improve this answer
    
:0 is only the term for the "console" in X. –  depquid Apr 12 '13 at 13:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.