List User Login Details

[problem]

Needing to view current activity of users on the system.

[/problem]

[solution]

Most flavours of UNIX provide a number of tools, to tell you who is logged in or when they last accessed the system.

[/solution]

[example]

A favorite of mine, is who -Hu – really good for seeing who is idle, quite literally! 🙂

Also you can just run last – although beware of rolled logs. Generally in /var/adm/wtmp* on Solaris and /var/log/wtmp* on Linux.

If you want to run last against an older file (by default it just uses wtmpx or wtmp) – just specify minus f – like this: last -f /var/log/wtmp.1

Additionally the finger command will quite often show last login time.

[/example]

[reference]

[tags]who, last, finger, Unix Coding School[/tags]

[/reference]

If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

Your email address will not be published. Required fields are marked *