How to show a list of currently logged in and logging out users?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to show a list of currently logged in and logging out users?
# 1  
Old 10-05-2014
How to show a list of currently logged in and logging out users?

Hi Guys!

I am sure that this question might appeared previously, but I still don't know how to show a list of logged out users. Please help with this!

Thanks in advanceSmilie
# 2  
Old 10-05-2014
How about
Code:
cut -d: -f1 /etc/passwd

# 3  
Old 10-05-2014
For logged out users only you can add on a pipe to omit users logged in from RudiC's command:

Code:
cut -d: -f1 /etc/passwd | grep -v "$(finger -f|awk '{print $1}')"


Last edited by pilnet101; 10-05-2014 at 12:51 PM..
# 4  
Old 10-05-2014
Note: these suggestions are incomplete if your system is also using any form of authentication other then local passwords.
# 5  
Old 10-05-2014
yes, there is an authentication.. how to make a list in that case?

Quote:
Originally Posted by Scrutinizer
Note: these suggestions are incomplete if your system is also using any form of authentication other then local passwords.
# 6  
Old 10-05-2014
logged out means the process no longer exists. The user account does.
The number of logged out processes grows every hour.

Code:
awk -F: '{print $1} ' | while read u
do
      last $u
done

Once you see this in action you will get the idea that you need to tweak your question a bit. I'll bet what you want is everybody who logged today (or yesterday), not since the UNIX box booted up 6 weeks ago. You probably also want times/dates.

So - show us your desired output.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

(RHEL, Bash) List users and check if they have logged on during the last 2 months

Hi everyone, At work we were told to check the list of users of an application server and delete all those that have left the company or don't need access to the application anymore. Here's what I came up with. Would you be as kind as to tell me your opinion and whether there is a faster / easier... (4 Replies)
Discussion started by: gacanepa
4 Replies

2. UNIX for Dummies Questions & Answers

apache logging - show more information

is it possible to make apache log each user activity in its log file "access_log" i have a web application here that uses apache. in the apache log files, i see that it shows when requests are made to certain pages in my web application. but it doesn't show the user name of the person making... (1 Reply)
Discussion started by: SkySmart
1 Replies

3. UNIX for Dummies Questions & Answers

How many users are logged in?

How do I find this out? I have a feeling its a simple command such as who, but I just don't know what it is. I've had a search on here but either I can't put it into the right search criteria or there isn't a topic on it. Thanks. EDIT: Delete this thread, as I posted it I noticed the... (0 Replies)
Discussion started by: chris_rabz
0 Replies

4. Programming

Get the list of logged in users

How can I get the list of logged in users in the system programmatically? I can get the list with 'who' or 'users' commands but I need to get the list programmatically... May someone help, please? Thanks in advance. (2 Replies)
Discussion started by: xyzt
2 Replies

5. UNIX for Dummies Questions & Answers

How to do a login time and date list of users never logged on?

Hello, I'm trying to do a list of user that never connected to a couple of servers. I want to do a diff between the servers lists, and print out only the users that never has logged on each server. Here my first step : SERVER01: # finger `egrep -v -e "^\s*#" /etc/passwd | awk '{ print $1 }' |... (4 Replies)
Discussion started by: gogol_bordello
4 Replies

6. Solaris

List all inactive users who has not logged on since last 90 days

I need actuall script which List all inactive users who has not logged on since last 90 days Thanks in advance. Di! (17 Replies)
Discussion started by: haridham
17 Replies

7. UNIX for Dummies Questions & Answers

List all inactive users who has not logged on since last 90 days

Hi, Can I get a script to list out all the users, who has not logged on since last 90 days. Last command in not working due due to /var/adm/wtmpx is more than 2 GB. Thanks in advance. Regards, Roni (10 Replies)
Discussion started by: manasranjanpand
10 Replies

8. Post Here to Contact Site Administrators and Moderators

logged out users

how to find out users who logged out within 5 minutes (1 Reply)
Discussion started by: roshni
1 Replies

9. Shell Programming and Scripting

Trying to get list of logged on users sorted

I'm trying to execute a single shell command that will give me a sorted list of all the users currently logged into the system, displaying the users name as it appears in /etc/passwd. I've tried awk -F: '{print $1}' /etc/passwd | xargs finger -s | cut -c11-28 | uniq This list whoever does... (7 Replies)
Discussion started by: kungfuice
7 Replies

10. Shell Programming and Scripting

how many users logged

in unix what is the syntax to find out how many users are currently logged in (4 Replies)
Discussion started by: trichyselva
4 Replies
Login or Register to Ask a Question