Sort current logged in users by log in time (supposedly to be very easy but I'm missing something)
1. The problem statement, all variables and given/known data:
Show all users who are currently logged in, sorted from earliest to latest log in time. The log in time includes the month, day, and time.
2. Relevant commands, code, scripts, algorithms:
finger, who, sort, pipe, head, tail,
3. The attempts at a solution (include all code and scripts):
I've also tried
(thinking that maybe column 7 is the time if you count Dec is 5th column, the 9th is 6th (see the output finger below)
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
De Anza College, Cupertino (California), US, Clare Nguyen, CIS 18A (It won't let me post link because I don't have 5 posts yet)
Here is an approach using awk that I wrote:-
Actually I am converting the login time to epoch and performing the sort. You can try doing the same in shell script. I hope this helps.
It's supposed to be just one single line command. We can use pipe. Can you think more simple? haha. I'm sorry but this is just an introductory class to Unix.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)