LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   List of active users (https://www.linuxquestions.org/questions/linux-desktop-74/list-of-active-users-4175451740/)

ThomasRonshof 02-26-2013 06:57 AM

List of active users
 
On telnet and ssh login, I can se active users with who, who -u ...

How can I se active users, running on Gnome desktop ? Thru XDMCP.

Regards

shivaa 02-26-2013 07:02 AM

Do you mean that those users who are connected to your machine thru some GUI tools (with gnmoe desktop installed) like VNC or Nomchine etc.?
Code:

~$ ps -aef | grep gnmoe-terminal
~$ pgrep gnmoe-terminal | wc -l


ThomasRonshof 02-26-2013 07:10 AM

well.... ps -ef | grep gnome-session is better then..... if there no command as 'who'.

They run X on thin clients connecting to the Gnome Desktop with XDMCP, some with SPICE clients.

shivaa 02-26-2013 07:19 AM

You can also use w command, which gives you command name also.
Code:

~$ w
~$ w | grep gnome-terminal


ThomasRonshof 02-26-2013 07:26 AM

Not all run gnome-terminal, so grep'ing for gnome-session is better on Redhat.

But it seems logged in users, where screensaver is active (going back in login), does'nt show up in 'w' !

When running 'top' I can see several users running firefox and putty, so this means they are active. But they does'nt show with 'who' or 'w'.

Gnome-who does'nt exist ? ;-)

shivaa 02-26-2013 08:19 AM

Firefox and putty are not gnome based utilities, so how can you see gnome terminal or gnome related applications with firefox or putty??

Those who are connected remotely, you can see them in terminal type pty or pts

So before suggesting anything more, let's know what 'exactly' your purpose is? Else who and w are more than enough.

ThomasRonshof 02-26-2013 08:22 AM

Well, I'm only looking for a command, that shows active users on the Gnome Desktop.

It seems for now, the only way is ps -ef | grep gnome-session

I can make an alias ;-)

ThomasRonshof 02-26-2013 08:23 AM

PS. who and w does NOT show all the desktop users, only some and only telnet/ssh sessions. this is on Redhat.

shivaa 02-26-2013 08:30 AM

Quote:

Originally Posted by ThomasRonshof (Post 4900076)
PS. who and w does NOT show all the desktop users, only some and only telnet/ssh sessions. this is on Redhat.

Then better use ps... as I said above. who and w will show you only those users who are connected, not those who are offline.

Try following cmds:

Code:

~$ ps -aef | grep gnome-terminal
~$ ps -aef | awk '/gnome-terminal/ {print $1}' | uniq
~$ man who
~$ man w
~$ info who


ThomasRonshof 02-26-2013 09:28 AM

Well, the users are not running gnome-terminal ! .... they are running firefox, thunderbird, libreoffice, putty...

shivaa 02-26-2013 09:51 AM

Quote:

Originally Posted by ThomasRonshof (Post 4900110)
Well, the users are not running gnome-terminal ! .... they are running firefox, thunderbird, libreoffice, putty...

Then invoke:
Code:

~$ ps -aef | awk '{print $1}' | uniq


All times are GMT -5. The time now is 04:31 PM.