0

i need to find the last 15 users that logged in to the system. i know there are commands like 'w' or 'who' or 'users' but as much as i know those commands refer only to users currnetly logged-in. but i need the user names of the 15 last active users - even if they already logged out...

the man of users say:

users - print the user names of users currently logged in to the current host

which command/s i need to find data about users that not active right now?

0

1 Answer 1

1

The last command lists the last logged-in users. The data comes from /var/log/wtmp and can be limited to n-lines with the -n <number> option. Other options allow one to select records "since" or "until" particular login times.

If the wtmp file doesn't exist, no logging occurs. To create the file if it doesn't exist, touch the file and set the ownership to "root:utmp" with 664 permissions.

1
  • Thank a lot JRFeguson, that exactly what i wanted. The second part is irrelevent since i'm not the system admin, but this is good thing to know anyway. Commented Oct 18, 2018 at 15:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.