This is certainly a case of rtfm, as I've come across many similar posts, but I'm getting lost in trying to find what I'm looking for. I imagine awk or grep will be able to help somehow, I could use some assistance in pointing me in the right direction.
I have a future plan of writing a script with prompts that another user can run for this function, but first I want to get the basic idea to work for myself.
I need to use
who -u to display currently logged on users, and then based on the time they are idle for, display their userid, idle time, and pid.
01sale1 pts/11 2016-10-05 06:39 00:04 14132 (192.168...) 01sale2 pts/16 2016-10-05 06:40 00:07 17902 (192.168...) 01sale3 pts/14 2016-10-05 06:40 . 17779 (192.168...) 01sale5 pts/25 2016-10-05 06:41 00:04 18339 (192.168...)
The list is quite long when everyone is on, and we are running into issues reaching the limit of licenses for this specific software. Until that is resolved, I need to kick users idle over an hour or so.
What I would like is to run who -u to show me just columns 1, 5 and 6 based on if column 6 is over an hour, so it would appear 01:** or above.
Eventually, I want to make a script that a user without root privileges can run to show them this info, and then kill idle users. I'm not sure if I want this totally automated or not yet though.
I'm running this application on an older Red Hat