Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
33 views

`who am i` not working with terminal but working with xterm

When I entered who am i on my terminal, there is no output, no matter whether I use bash or zsh. But with XTerm, who am i prints my login info. Why does this happen? What difference does zsh or ...
9
votes
1answer
335 views

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 " " ...
0
votes
3answers
55 views

Seeing user two times

Consider I have created a user 'test' during Installation which I use to login to my system. My root user is 'root'. I further open two terminal sessions for each of the users respectively. Now the ...
1
vote
1answer
121 views

Why is top command showing users that the who command is not?

Working on a Raspberry Pi 2, running Raspbian GNU/Linux 9 (stretch). I am simply trying to understand why, when I run the top command I can see some users that I cannot see in the who command. Here ...
-4
votes
1answer
53 views

Linux: How to display the output of both command who and pwd using 1 command [closed]

I tried: who & pwd and it output the result of pwd output: /root. May I know if I am right?
0
votes
1answer
32 views

The console terminal demonstrate by who

When I issue the command who in a bash terminal: $ who me console 2018-11-09 07:13 me ttys000 2018-11-09 07:13 me ttys001 2018-11-09 07:13 The manual states: who - show who ...
1
vote
2answers
165 views

Source of information - command who

I would like to know how the command "who" pulls out information about ssh history into a Linux system. For example, on my shared-network workstation, where everyone can ssh into it: [johny@gandor ~]$...
0
votes
0answers
41 views

who -u command shows internal IP due to iptables NAT and MASQUERADING rules setup, how to get the original IP?

who -u command shows internal IP due to iptables NAT and MASQUERADING rules unknown to my application running on the system, how to get the original IP? I was asked to use ip netns exec management ...
0
votes
1answer
22 views

who and w report my user ten times..but I have only four pts open

The command w said 02:50:35 up 20:54, 10 users, load average: 1,07, 1,29, 1,41 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT myuser :0 - lun05 ?xdm? 1:...
0
votes
1answer
100 views

Bash User Input Search For Who is On Server If Statement Error Too Many Arguments

I am working on an assignment that requires me to accept user input to search for current users on the server and if the user input is online, I need to output the users name. If the user is not ...
2
votes
1answer
232 views

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 ...
0
votes
1answer
598 views

Commands I can use to determine who is logged in on a specific terminal?

I am in a Linux/Unix Systems class and I need to determine commands I can use to determine who is logged in on a specific terminal? I know there is the w, who, or finger commands. Do any of these ...
7
votes
3answers
9k views

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 ...
6
votes
2answers
3k views

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 ...
0
votes
0answers
84 views

The `who` order means do not matching the xxx@localhost's xxx?

Who can explain the difference between the yangmi and liao1 to me? I mean, in the below, I use the who order to show the current user get liao1, but in the [yangmi@localhost ~]$ it is yangmi, who can ...
2
votes
1answer
67 views

LinuxMint - `who`, `w` and `last` don't report terminal-emulators anylonger

I'm running an up-to-date version of LinuxMint (an Ubuntu-fork), and I've noticed that who, w and last have all stopped registering activity on terminal-emulators (like xterm) - eg. if you open a ...
0
votes
2answers
1k views

How can I hide my IP from linux who command [closed]

I am a Linux system admin, I will login every system of my local network. I don't want my IP to show up via who command. For example, if someone enters: $ who it reveals my IP. Is there any way to ...
2
votes
1answer
318 views

A proper replacement for the `logname` utility? [closed]

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, ...
2
votes
3answers
278 views

Using pipes to list the first two and last two users on the system?

I have to use the who command to display who's online, then use pipes to display the first and last 2 users online. the only thing I know how to do is something like: who | head -5 | tail -2 . ...
6
votes
3answers
7k views

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 ...
16
votes
1answer
175 views

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 ...
0
votes
1answer
226 views

I am trying to get a list of all users who haven't logged in 30 days but code isn't working

echo here is a list of the users who have not logged in for a month olduser="who | grep | -u, -q +30" if $olduser then echo these users havent been logged in for thirty 30 days else echo user is ...
0
votes
1answer
111 views

how to read ssh output from 'last' and 'who' command

I have just used the command 'last' to see who has logged into my server. I am unsure how to read some of the output, particularly in Column 2 where it states pts/l and :0. Instead of spoon feeding ...
1
vote
1answer
109 views

Display used by screen in utmp

The X window system in a desktop Linux (where just one physical monitor is used) usually uses display 0, screen 0. The output of who in Ubuntu 14.04 is user1 :0 2016-06-15 14:25 (:0) ...
0
votes
2answers
1k views

why is btmp not showing the username of logged in users?

I am trying to compare the output of the btmp file and who -a commands. I don't know why, but btmp file currently is not showing the username but its showing UNKNOWN in the username field. I am (...
0
votes
1answer
94 views

How can I reveal the real name of the users online (with university IDs)?

In the terminal, how can I reveal the real name of the users online (with university IDs)? getent?
1
vote
2answers
10k views

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? ...
-3
votes
1answer
602 views

Explain who commands 4th column [duplicate]

I have graphical machine of rhel7 , when i run who command , the output of 4th column is ':0' , what does that mean? When my other machine take access of this graphical machine , the output of who ...
-2
votes
2answers
84 views

Explain who command's ':0' value in 4th column's output [duplicate]

I have a graphical machine of rhel7, when i run who command , one of the outputs in 2nd column is ':0'. What does ':0' mean ?
0
votes
2answers
793 views

Explain who command output in 2nd column [duplicate]

I have 2 machine setup of rhel7 , one is in terminal mode and the other is in grahical mode , when I run 'who' command on both the machines why do I get 'tty' in 2nd column output for the machine in ...
2
votes
1answer
201 views

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 ...
2
votes
1answer
90 views

Why does the `users` command return different users depending on whether I ssh or open a new terminal?

How does users define what users are logged in? If I ssh into a box twice, I see my username twice listed if I execute users. However, if I create a new login shell via sudo su -, I do not see root ...
1
vote
2answers
2k views

How would I grep for a password file entry without using 'username'

Can a who command be integrated to find the current logged in users password file entry?
3
votes
1answer
72 views

Who command: what is S on slackware?

who -r run-level 4 2015-01-19 21:56 last=S I'm on slackware,what does it mean S? Previous runlevel?
3
votes
2answers
75 views

I want to reboot the system once a search had been done to see that no-one is logged in

I'm working on a user menu so that when a user logs in all they get is this menu; on this menu is a selection of reboot option. I want one of the options to be reboot the system if no one is logged in....
2
votes
1answer
2k views

Scripting: Counting users logged in onto the system

I have the following script. #!/bin/bash #Solution script1 who date +"Today %d %B, there are $# users logged in onto the system" In the background user1 has logged in onto tty2 and tty3 and root ...
3
votes
3answers
41k views

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 ...
2
votes
1answer
2k views

Identify the outgoing connection (ssh) with the who command

After a ssh connection, if I run the who command on the server : I have this response : olivia@olivia-pc:~$ who olivia :0 2014-09-08 11:40 (:0) olivia pts/0 2014-09-08 11:43 (:0)...
3
votes
2answers
2k views

Is there a way to prevent a non-terminal-attached process from executing 'who' inside my .envfile?

I made some modifications to the /home/user/.envfile so the PS1 prompt would show date/time as well as the pwd etc. The modification is: # `who am i` is used to obtain the name of the original user ...
0
votes
1answer
976 views

What is the :0 terminal in the who command's output? [duplicate]

When I type who in my console terminal, I get the following output: hubert :0 2014-05-16 21:40 (:0) hubert pts/0 2014-05-16 21:46 (:0) From info who I know that both :0 and pts/...
27
votes
2answers
6k views

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 ...
3
votes
3answers
3k views

Print unique of who command

I want to show the online users using the who command but I want to have a unique output and not show any duplicates. I piped the output into awk but I am not very familiar with that, is this the ...
4
votes
1answer
2k views

'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 --...
1
vote
1answer
536 views

who -b date format varies strangely

I run who -b to get the date of the last reboot. It returns 2013-10-29 14:55. Now ran by a daemon (I am sending this date to a server) it returns Oct 29 14:55. But some other times (before last reboot ...
0
votes
1answer
139 views

How many XUSER's

I'm working on a script an I need to show how many people are logged into XServer. It was suggested that I look at the last part of the who command (N:N): user1 tty7 2013-10-10 12:14 (:0) ...
2
votes
2answers
3k views

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 ...
101
votes
2answers
105k views

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 ...