alex@alex-laptop:~$ whoami
alex
alex@alex-laptop:~$ who
alex     tty7         2008-02-20 18:40 (:0)
alex     pts/0        2008-02-21 09:10 (:0.0)
alex@alex-laptop:~$

What does the second command mean? I'm logged in twice as alex?

And also, what does tty7 and pts/0 mean? And also, after the date and time, the (:0) and (:0.0). What do those mean?

Basically, what is this command telling me about the logged in users?

Dani AI

Generated

As pointed out, the two lines from who are two sessions for the same user, not two separate accounts. who reports entries from the system login record (utmp), so one line can be the graphical/login seat and the other a shell inside a terminal emulator. See the utmp format and purpose for how those records are created: utmp(5) — Linux manual page.

The device names are different kinds of terminals: tty7 (a kernel virtual console device like /dev/tty7) is commonly the virtual terminal where a graphical session runs, while pts/0 is a pseudo‑terminal assigned to a terminal emulator (under /dev/pts) — those are explained here: Pseudoterminal — Wikipedia. The parenthesized (:0) or (:0.0) are X display identifiers (display number and screen number) used by the X server; :0 is display 0 and .0 is screen 0: .

To investigate further on your machine try these commands to see more utmp fields, the active pseudo-ttys, and which processes own a pty or VT:

who -a
ls -l /dev/pts
ps -t pts/0 -o pid,user,cmd

On systemd systems loginctl list-sessions also shows seats and sessions. In short: nothing alarming — who is just listing two active sessions for the same user on two different terminal devices.

Recommended Answers

All 2 Replies

>What does the second command mean? I'm logged in twice as alex?
Sort of. tty7 is your 'virtual terminal' which X runs on. 'pts' is a pseudo terminal, which would be the terminal window you're executing the 'who' command from.

>And also, after the date and time, the (:0) and (:0.0). What do those mean?
Those refer to the display/screen that they're running on. The first part, :0, is the display. The .0 is the actual screen it's running on.

Thanks again! :)

You have all the answers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.