Quote Originally Posted by sand_man View Post
This sounds like homework. Have you made an attempt? Please post some code to show that you have.
I'll give you the benefit of the doubt and give you a hint. All the information you need should be in a log file in /var/log/ - Sometimes it will be in security.log or auth.log depends on the distribution. All you need to do is extract it and format it.
Hi, thank you for your answer. No, it's not homework. It's just an excercise for myself that I would like to complete. I have already used the 'last' command which extracts info from the var/log/wtmp file. The only problem is that I don't know how to format the text correctly. I should probably save the text returned by the last command into a file or variable but I don't know how to begin. If you could give me any hints I would really appreciate it.

Thank you