Score:0

Linux equivalent to "query user /server:my-server-address"

ru flag

The command from the title displays all connected users for my terminal server. Is there an equivalent linux command to display the same information?

Score:0
in flag

The simple who command probably gives you a good list here.

There is also the w command.

Score:0
pe flag

w

For a little more context about users, the simple w command provides a list of who’s logged in and what they’re doing. This information is displayed in a format similar to the output of who, but the time the user has been idle, the CPU time used by all processes attached to the login TTY, and the CPU time used by just the current process. The user’s current process is listed in the final field.

Sample output:

$ w
 13:45:48 up 29 days, 19:24,  2 users,  load average: 0.53, 0.52, 0.54
USER     TTY     LOGIN@  IDLE    JCPU   PCPU WHAT
seth     tty2    Sun18   43:22m  0.01s  0.01s /usr/libexec/gnome-session-binary
curly    pts/2   13:02   35:12   0.03s  0.03s -bash

Alternatively, you can view the user’s IP address with the -i or --ip-addr option.

You can narrow the output down to a single user name by specifying which user you want information about:

$ w seth
 13:45:48 up 29 days, 19:27,  2 users,  load average: 0.53, 0.52, 0.54
USER     TTY     LOGIN@  IDLE    JCPU   PCPU WHAT
seth     tty2    Sun18   43:25m  0.01s  0.01s /usr/libexec/gnome-session-binary

ps

Once you know who’s logged in on your system, you can use ps to get a snapshot of current processes.

You can get all processes being run by a single user with the --user (or -u) option, along with the user name of who you want a report on. To give the output the added context of which process is the parent of a child process, use the --forest option for a “tree” view:

$ ps --forst --user larry
  PID TTY        TIME     CMD
  39707 ?        00:00:00 sshd
  39713 pts/4    00:00:00  \_ bash
  39684 ?        00:00:00 systemd
  39691 ?        00:00:00  \_ (sd-pam)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.