11

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.

1 Answer 1

15
  • 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

4
  • Thanx @Sylvain Pineau,,well what does it mean to accept a message,,because when I am running $who -a in text terminals I am always getting (-) only ,no (+) ,,and ? is always with (:0)??
    – lazarus
    Sep 20, 2014 at 12:26
  • 1
    @jazz: I've added info about the mesg command Sep 20, 2014 at 12:36
  • I would say "stat'ed" instead of "stated" since the latter is kind of confusing
    – nneonneo
    Sep 20, 2014 at 21:19
  • @nneonneo fixed, thx Sep 21, 2014 at 7:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .