Currently I am using Ubuntu 20.04.3 LTS Problem which I am having now is that who and w commands who 0 users are logged in system.
mypc:~$ who
mypc:~$ w
22:14:10 up 12 min, 0 users, load average: 0.52, 0.58, 0.59
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
I am logged in the system, but why are these commands showing that 0 users are logged in currently?
command-line
, meaning I could single-handedly close it. Game lover, if the dupe does not answer your question, please let me know and I'll vote to reopen. – terdon Feb 28 '22 at 21:51who
doesn't really work on WSL. – terdon Feb 28 '22 at 22:08ps aux | tail -n +2 | awk '{print $1}' | sort -u
to see the list of users currently running processes, but that would include system users as well. You can exclude those with something likeps aux | tail -n +2 | awk '{print $1}' | sort -u | grep -f <(grep -Ev 'nologin|/false' /etc/passwd | cut -d: -f1)
which you could make into a function or alias. – terdon Feb 28 '22 at 22:13who
? What are you going to do with it) and someone might be able to come up with an answer. – terdon Feb 28 '22 at 22:26