Sort current logged in users by log in time (supposedly to be very easy but I'm missing something)


 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Sort current logged in users by log in time (supposedly to be very easy but I'm missing something)
# 8  
Old 12-10-2012
Let me explain the problem with using finger, since finger is showing abbreviated month, we cannot apply a numeric or alphabetical order sort on the date. This is the reason why I suggested to convert the date to epoch and perform the sort.
This User Gave Thanks to Yoda For This Post:
# 9  
Old 12-10-2012
Hey, I solved it myself. Finally. I overly complicated the matter

Code:
 who | sort -M | sort +3 -4 +4 -5

Thanks for your help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Log search and mail it if the log is updated before 24 hours from the current time

Hi , We have around 22 logs , each has different entries. I have to automate this using shell script. The ideas which am sharing is given below 1) We use only TAIL -100 <location and name of the log> Command to check the logs. 2) We want to check whether the log was updated before 24... (13 Replies)
Discussion started by: Kalaihari
13 Replies

2. Shell Programming and Scripting

Specified log in time for users

I have this task : Check the logintime.txt every minute to only allow user to log in at the specified time. logintime.txt has the following content: USER TIME_START TIME_STOP Example: john 17:00 18:00 My idea is locking the user at the TIME_STOP and unlocking at the TIME_START while... (4 Replies)
Discussion started by: muffle
4 Replies

3. Shell Programming and Scripting

current logged in user

Hey guys I need a script that reads a login name and verifies if that user is currently logged in i have found few commands like "who" and "users" but i wonder how can i verify it that login name is logged in or not? (3 Replies)
Discussion started by: nishrestha
3 Replies

4. OS X (Apple)

Guest missing from Log In Window but still Logged In

I have information on my Guest account on a webpage that is vital to my being able to leave to go home. I can leave as SOON as I recover this password, otherwise I'll have to wait a whole week :( Here's the thing: I entered login information on a site in the Guest Account. The computer has... (1 Reply)
Discussion started by: TurkeyBody
1 Replies

5. Shell Programming and Scripting

Get current logged in user from a script run as root.

Ok, so, in order to install some dependencies of a program I made, a script has to be run as root. The thing is that I have to copy some things into the home folder of currently logged in user, but the variable $HOME returns '/root' and the $USER returns 'root' :( Is there any way to see who is... (7 Replies)
Discussion started by: hakermania
7 Replies

6. Red Hat

Current logged in users

I have 2 systems. (1) RHEL5 and (2) winXP pro from xpPRO putty i ssh into rhel5 : user root from xpPRO i ftp into rhel5 : user abc123 when i run #uptime it only shows 1 user when i do #ps -u abc123 : it shows vsftpd deamon PID is there a command that can be used to show all currently... (4 Replies)
Discussion started by: dplinux
4 Replies

7. UNIX for Dummies Questions & Answers

Finding users logged on time and space useage

I need to find what users are currently logged onto the system that is easy just a simple who | awk '{ print $1 }' (thats all I need for the part), but I also need to find how long they have been logged on and the total amount of file space they are using. Thanks in advance, I have been looking... (3 Replies)
Discussion started by: mauler123
3 Replies

8. 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

9. Shell Programming and Scripting

shell script not getting current error messages with time from alert.log

Hi All, I need to get current error messages with time from alert.log.Below is my shell script but it's not working to meet this objective. could anyone pls share on the above issue for resolution: #################################################################### ## ckalertlog.sh ##... (2 Replies)
Discussion started by: a1_win
2 Replies

10. UNIX for Dummies Questions & Answers

Finding last time users logged in

I would like to find out the last time all users have logged in or out. I tried the last command, but it could not find the wtmp file in /var/adm (I searched in othe directories also). This is an AIX rs6000 4.2.1 system. We are moving our applications from this system to an AIX 5.2 system and I... (11 Replies)
Discussion started by: jyoung
11 Replies
Login or Register to Ask a Question