3

I want to get last logins from a certain date using last

Running

last -f /var/log/btmp -t 20140723123000

Always shows my whole lastb log.

This:

last -t 20140723123000

Shows my whole last log. eg:

bob     pts/1        172.16.14.37     Thu Feb 27 09:38 - 09:56 (4+00:18)
tim     pts/1        172.16.14.37     Wed Feb 19 11:32 - 09:34 (7+22:02)
root     pts/1        172.16.14.37     Mon Feb 17 09:50 - 12:04 (1+02:14)

The manual seems to say "Display the state of logins as of the specified time"

There is no year outputted, is this an issue?

Update:

Red Hat 5.5

Running last -V returns : last: invalid option -- V (running man last shows no -V option)

Running last -s returns : last: invalid option -- s (running man last shows no -s option)

Kiksy
  • 253
  • you can use -F as the manual suggests to get full information. – Valentin Bajrami Jul 23 '14 at 12:16
  • man last doesn't show -F as an option, and I get invalid option -- F when trying to use it. I don't think thats the reason -t isn't working though. – Kiksy Jul 23 '14 at 13:01
  • Can you update the question and show last -V Also, have you looked at the -s flag? What system are you running? – Valentin Bajrami Jul 23 '14 at 13:09
  • What is your actual question here? Are you asking if vthe lack of year is a bug? There's no year because it is this year. – terdon Jul 23 '14 at 13:22
  • The question is , why when I run last -t 20140723123000 do I get logins from January, March etc. – Kiksy Jul 23 '14 at 13:24
  • @Kiksy the -t, --until time option is untill the specified time not -s, --since time which is what you want imo. Can you pastebin man last somewhere? – Valentin Bajrami Jul 23 '14 at 13:26
  • Man last pastebin: http://pastebin.com/DVFEfugL – Kiksy Jul 23 '14 at 13:28
  • Well I have no idea what last that is. It seems to be a fork or something. I've looked at mine and also here http://manpages.courier-mta.org/htmlman1/last.1.html Both discuss the -s flag. – Valentin Bajrami Jul 23 '14 at 14:22

0 Answers0