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 |
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 |
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.
|
Try
Code:
ps -ef|awk '{print $1}'|sort -u |
I don't want to get users who have logged off but left processes running. Just logged in users.
|
All times are GMT -5. The time now is 03:36 PM. |