Shell script to display user logged last week and time connected

Hello all,
I want to display all the user logged last week and know the time tnat they are connected. I have been looking for a solution in the Forum, but I didn't find.
Thanks in advance

man who

Thanks ctsgnb, I had read the options of who. But I didn't find anything where I can put a period of time.

who shows who is logged in (now).

last shows both who is logged in now, and who was logged in previously, as well as how long they were logged in for. The output requires some parsing to get to the information you are looking for.

On AIX, I'd use fwtmp (to read the wtmp file that holds this information) to make this easier. There should be a similar command for other OS's.

man last

:wink: