LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-18-2013, 08:06 AM   #1
Brandon9000
Member
 
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Rep: Reputation: Disabled
Need to See Logged In Users


If I open several Gnome terminal windows and on one of them type:

su - gwashington

and log in for that user, then the command prompt changes to show me that I am now user gwashington, which is also confirmed if I run whoami. Furthermore, running "ps" shows several processes owned by gwashington.

However, if I run the command "who," "w," or "users," I see only my actual userID in the list and user gwashington is nowhere to be found. How can I see a complete list of logged in users? I will not be satisfied with a clever explanation of why I don't see the gwashington ID. I need to be able to detect it in a full list of users.

Thanks in advance.

Brandon
 
Old 03-18-2013, 09:29 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
If you want to detect all users as well as users who are logged in by other users, you can use this.

Code:
ps auh | cut -d ' ' -f1 | sort -n | uniq
 
Old 03-18-2013, 12:21 PM   #3
Brandon9000
Member
 
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Original Poster
Rep: Reputation: Disabled
An interesting idea, but I don't want to get users who have logged off but left processes running. Also, I do want to get users who are in by telnet, ssh, etc.
 
Old 03-18-2013, 08:45 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Try
Code:
ps -ef|awk '{print $1}'|sort -u
??
 
Old 03-19-2013, 06:52 AM   #5
Brandon9000
Member
 
Registered: Apr 2012
Location: Florida
Distribution: Many
Posts: 111

Original Poster
Rep: Reputation: Disabled
I don't want to get users who have logged off but left processes running. Just logged in users.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Logged in users xlordt Linux - Newbie 3 11-01-2007 10:54 PM
4 of the same users logged on... true_atlantis Linux - Newbie 1 04-13-2006 11:54 PM
why so many logged in users? alagenchev Linux - Security 2 03-24-2005 06:19 PM
users who logged before czezz Solaris / OpenSolaris 1 11-24-2004 06:12 AM
No Users logged in X kaise_sose Linux - Software 2 10-19-2004 02:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration