-1

I need to get the details of the users logged in from last 6 months to analyze and to increase the cpu of my server. I'm tried the command last -a but it is not giving the complete results. Anyone please help me to get the details of users logged in from last 6 months.

Thanks in advance!

Ravexina
  • 57,256
Harsha
  • 329

1 Answers1

0

Newer versions

You can use -s option:

last -s  -6month

Display the state of logins since the specified time.

use -t to specify until another date if you like.

If you receive a message like:

wtmp begins Tue Apr ...

it means that "logrotate" has removed your log files so you don't have access to use them.

for older versions you should specify full time:

last -t 20170101000000
Ravexina
  • 57,256