Questions tagged [who]

Command to list which users are logged in the system. For questions related to how to interpret and use the coreutils who command.

58 questions
151
votes
2 answers

Difference between pts and tty

Possible Duplicate: What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? I always see pts and tty when I use the who command but I never understand how they are different? Can somebody please explain me this?
pradeepchhetri
  • 9,859
  • 12
  • 51
  • 59
34
votes
2 answers

Is `who mom likes` a real linux command?

I stumbled across a blog that mentioned the following command. who mom likes It appears to be equivalent to who am i The author warns to never enter the following into the command line (I suspect he is being facetious) who mom hates There is…
spuder
  • 17,643
  • 36
  • 91
  • 119
15
votes
1 answer

Why is "who mil" allowed to produce no output?

In the 2016 edition of IEEE Std 1003.1-2008 (a.k.a. The Open Group Base Specifications Issue 7, or just the POSIX standard), the Rationale section of the who utility mentions the following: It is acceptable for an implementation to produce no…
Rhymoid
  • 322
  • 2
  • 10
11
votes
2 answers

who, whoami, and "who am i"

I can understand the commands who and whoami, but what exactly happens when I type: who am i and who am I am on Ubuntu, nothing happens after them! Why doesn't Linux / UNIX reply with an error message (something on the line of "unknown…
A. N. Other
  • 211
  • 1
  • 2
  • 4
11
votes
3 answers

What is the difference between **pts** and **tty** and **:0**?

Please help me to distinguish pts from gui mode generated from tty. booting to multi-user.target I did this: sudo systemctl set-default multi-user.target reboot login with regular user debian8 ctrlaltf2 and login with regular user debian8…
showkey
  • 79
  • 23
  • 67
  • 128
10
votes
3 answers

Difference between who and whoami commands

The man page description of who command is who - show who is logged on But there exists a similar command whoami. The man page description of whoami is whoami - print effective userid Can anyone explain what exactly these commands do ? How are…
narendra-choudhary
  • 808
  • 2
  • 8
  • 15
9
votes
1 answer

Different outputs for `w`, `who`, `whoami` and `id`

In command line platforms online, like for instance the one on Codecademy, when I run for cmd in w who whoami id do echo $cmd $cmd echo ========================= echo " " done I…
whoami
  • 93
  • 1
  • 4
7
votes
2 answers

who shows (unknown) user logged-in: what's going on?

In a RHEL 7.3 server, I was trying to find logged-in users. I ran w and it told me there were two users, but it only showed me the info of one (myself); then I ran who, which displayed the other user as (unknown). Finally, I ran lastlog, with…
Samuel
  • 292
  • 3
  • 10
6
votes
1 answer

'who --message' -> which message?

I found the following in man who: -T, -w, --mesg add user's message status as +, - or ? --message same as -T --writablesame as -T So looked up info who and found -w -T --mesg --message --writable After each login name print a character…
erch
  • 4,890
  • 17
  • 49
  • 81
4
votes
2 answers

What does the `who` command result `root :0` mean?

The return value of command who will always include root :0 in X Window pts. I guess it actually means the GNOME login. Am I right? Another question is where to get this knowledge, as I don't see it in the man who, neither in info…
user43312
  • 951
  • 2
  • 12
  • 20
4
votes
1 answer

A proper replacement for the `logname` utility?

The logname utility became unusable a while ago for many users, since it relies on something that has been broken intentionally due to security concerns, as discussed here. As I read the discussion, it is unlikely that the functionality is going to…
Wanderer
  • 205
  • 2
  • 7
4
votes
2 answers

List logged in users (name, terminal, logintime)

I'm trying to print a list of users, who are currently logged on a terminal. It should look like this: I only got this so far: I'm missing the Terminal and the Login time. How can I display them? This is what I got so…
user143230
  • 41
  • 1
  • 1
  • 2
3
votes
1 answer

Change date format for who in FreeBSD

Unlike Linuxae which outputs 2022-11-07 16:23, FreeBSD who command outputs Nov 7 16:23. How can I change the date format in the output of who either globally or just for the duration of the command? Example output of who on FreeBSD 13.1-p3, in the…
user548271
  • 31
  • 1
3
votes
1 answer

Is it necessary for a login-shell to create utmp entry?

My observation: If I open a new terminal (gnome/lx): New /dev/pts/X is used who does not lists these First character of echo $0 is not -, so its not a login-shell. If I ssh into the same machine with the same user New /dev/pts/X is used who…
P Pang
  • 133
  • 5
3
votes
1 answer

How to Use who/w with Non-Interactive SSH logins

I'd like to perform selective shutdown of a server in my house after backing-up over SSH. My post-backup script waits for five minutes and then runs a very short 'safe shutdown' script located on the server. This script was using who -q to get the…
stellarpower
  • 156
  • 5
1
2 3 4