what is pts/0 , :0 and attributes before it + ,? etc

While reading about Linux, I got a $ who -a, so before trying that I logged into three of my text terminals (tty1,tty2,tty3) respectively,, and then I came back to X-window (Ctrl + Alt +f7),, then I tried:-

$ who
anupam   tty2         2014-09-20 16:19
anupam   tty3         2014-09-20 16:20
anupam   tty1         2014-09-20 16:18
anupam   :0           2014-09-20 16:14 (:0)
anupam   pts/0        2014-09-20 16:21 (:0)
$ whoami
anupam
$ who -a
           system boot  2014-09-20 16:13
           run-level 2  2014-09-20 16:13
LOGIN      tty4         2014-09-20 16:13               736 id=4
LOGIN      tty5         2014-09-20 16:13               740 id=5
anupam   - tty2         2014-09-20 16:19 00:01        3200
anupam   - tty3         2014-09-20 16:20   .          3346
LOGIN      tty6         2014-09-20 16:13               752 id=6
anupam   - tty1         2014-09-20 16:18 00:02        3044
anupam   ? :0           2014-09-20 16:14   ?          1835 (:0)
anupam   + pts/0        2014-09-20 16:21   .          3455 (:0)
$ 

I am not getting some terms in second attribute (- tty2,-tty 3,-tty1i [why - is there in front of them?]) ?:0 (I guess it is indicating my X-window startup [why is there a ? before :0?]), and values at fourth attribute [00:01, ., 00:02, ?, .]?

I tried to look at $ man who -a, but I didn't got these explanation.


Solution 1:

  • pts/0 is a Pseudo-Terminal Slave (See What does "pts/" in the output of w mean?).

  • The (:0) tells you which display you're using.

  • the +,-,? tells you whether a user/tty is accepting messages. If true, display a + for each user if mesg y, a - if mesg n, or a ? if their tty cannot be stat'ed.

    See the mesg man page:

    NAME
           mesg - control write access to your terminal
    
    SYNOPSIS
           mesg [y|n]
    
    DESCRIPTION
           Mesg  controls  the  access to your terminal by others.  It's typically
           used to allow or disallow other users to write to  your  terminal  (see
           write(1)).
    
    OPTIONS
           y      Allow write access to your terminal.
    
           n      Disallow write access to your terminal.
    
           If no option is given, mesg prints out the current access state of your
           terminal.
    

Source: who.c