1830624 Members
1960 Online
110015 Solutions
New Discussion

Command Last and lastb

 
leonardop
Occasional Contributor

Command Last and lastb

Hi...

which options of the "last and lastb" command, allows you to filter the output according to date: month and year?
4 REPLIES 4
F Verschuren
Esteemed Contributor

Re: Command Last and lastb

I can not do this whit last
but a good grep can help....
Robert-Jan Goossens
Honored Contributor

Re: Command Last and lastb

Hi,

Not directly possible, you could limit the number of lines.

# last -500

Regards,
Robert-Jan
James R. Ferguson
Acclaimed Contributor

Re: Command Last and lastb

Hi:

You can use 'fwtmp' to convert the binary files to formatted ASCII ones:

# last|/usr/sbin/acct/fwtmp

This output includes the time and year of the record as well as (most importantly) the epoch seconds representation of the date and time timestamp which immediately preceeds the date (month) in the output.

Regards!

...JRF...
Sandman!
Honored Contributor

Re: Command Last and lastb

Don't think there is any such option. Need to write your own script/code for this.