• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

finger command

pontifex

Lifer
We have a Unix system here that our manufacturing system runs on.

We frequently use the finger command to see who is logged in and how long they have been idle in the system.

It gives the login id, their name, TTY, Idle time, last login, and IP address.

Is there a switch that will allow me to sort by idle time, so that I can see the people who have been idle the longest in descending order (longest idle time to shortest idle time)?

 
This works on solaris 10:

finger -i | grep days | awk '{print $7 " days - " $1}' | sort -rn

That will give you a list consisting of #days followed by user name in reverse order. I guess you could write a script to check and sort by hours as well.
 
if the output of finger is line of information per user you can pipe it into sort command and get what you want that way.

Haven't used it in years so I don't remember.
 
Back
Top