3

I was looking for some shell commands, and I took a look in "users" command.

I was hoping to get only 1 name, but I got 2:

nori@nori-hidamari:~$ users
nori nori

And when I run the command "who"

nori@nori-hidamari:~$ who
nori     :0           2015-04-09 09:31 (:0)
nori     pts/0        2015-04-09 09:48 (:0)

Is this behaviour normal? Or it's bad?

Thank you guys for helping me.

2
  • Do you have three terminals open?
    – muru
    Apr 9, 2015 at 12:49
  • @muru just updated it now. I had 2 more terminals. But still, I'm getting my user 2 times.
    – Nori-chan
    Apr 9, 2015 at 12:50

2 Answers 2

7

This is normal expected behaviour.

You see your user name twice because you are logged in twice.

[simmel]@[mars]$ users
simmel simmel

The second command

who

shows which user is online right now and it looks like you were online at that time with Graphical Display :0 and pts/0 (a terminal window).

[simmel]@[mars]$ who
simmel   tty8         2015-03-30 11:15 (:0)
simmel   pts/3        2015-04-09 14:16 (:0)

After opening some more terminals it looks like this:

[simmel]@[mars]$ who
simmel   tty8         2015-03-30 11:15 (:0)
simmel   pts/3        2015-04-09 14:16 (:0)
simmel   pts/4        2015-04-09 14:54 (:0)
simmel   pts/8        2015-04-09 14:54 (:0)

After opening more windows the count goes up in users:

[simmel]@[mars]$ users
simmel simmel simmel simmel
3
  • The output of users is not username group.
    – muru
    Apr 9, 2015 at 12:56
  • ops you are right ^^ I will change that
    – s1mmel
    Apr 9, 2015 at 12:58
  • Excellent answer! Upvoted and edited! ;-)
    – Fabby
    Apr 12, 2015 at 22:32
2

It is normal. You will have an entry for the graphical desktop you have logged into (labeled with the corresponding DISPLAY - in this case :0), and one each for each terminal you have open (labeled with the pseudo-terminal corresponding to each of them (pts/X)). Since you're running this command in a terminal, you will of course have one entry corresponding to that terminal, hence a minimum of two.

You must log in to answer this question.

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