Ubuntu – Using “users” command gets the name 2 times

14.04command line

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.

Best Answer

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
Related Question