"last" command not working properly
Always use man X directly on the Mac itself to see what is available for command X.  The reason is that OS X was originally based on BSD and not GNU (most likely to avoid the GPL) so you should not follow Linux tutorials for MacOS.