LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 02-26-2013, 06:57 AM   #1
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 115

Rep: Reputation: 0
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
 
Old 02-26-2013, 07:02 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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
 
Old 02-26-2013, 07:10 AM   #3
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 115

Original Poster
Rep: Reputation: 0
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.
 
Old 02-26-2013, 07:19 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
You can also use w command, which gives you command name also.
Code:
~$ w
~$ w | grep gnome-terminal
 
Old 02-26-2013, 07:26 AM   #5
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 115

Original Poster
Rep: Reputation: 0
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 ? ;-)
 
Old 02-26-2013, 08:19 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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.
 
Old 02-26-2013, 08:22 AM   #7
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 115

Original Poster
Rep: Reputation: 0
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 ;-)
 
Old 02-26-2013, 08:23 AM   #8
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 115

Original Poster
Rep: Reputation: 0
PS. who and w does NOT show all the desktop users, only some and only telnet/ssh sessions. this is on Redhat.
 
Old 02-26-2013, 08:30 AM   #9
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by ThomasRonshof View Post
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

Last edited by shivaa; 02-26-2013 at 08:32 AM.
 
Old 02-26-2013, 09:28 AM   #10
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 115

Original Poster
Rep: Reputation: 0
Well, the users are not running gnome-terminal ! .... they are running firefox, thunderbird, libreoffice, putty...
 
Old 02-26-2013, 09:51 AM   #11
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by ThomasRonshof View Post
Well, the users are not running gnome-terminal ! .... they are running firefox, thunderbird, libreoffice, putty...
Then invoke:
Code:
~$ ps -aef | awk '{print $1}' | uniq
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing active users list Kalota Linux - Newbie 3 04-07-2011 10:00 AM
List 4 names from users list and output them to fbusers in numbered ascending order? fezzie Programming 4 02-10-2010 01:05 PM
Hiding certain Active Directory users from logon list when using winbind kamahl Linux - Security 0 12-01-2008 07:03 PM
adding proc list and task list of active processes. pravin.embedded Linux - Newbie 1 09-02-2008 01:20 PM
Active directory users to Samba users alexpacio Linux - Networking 0 05-19-2006 08:44 AM


All times are GMT -5. The time now is 12:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration