Where are logins logged?

jiblet

Registered
I set up Mac OS X for my mom so that she can finally keep my little brother and sister from screwing things up (she gets confused if an icon moves a little). She would also like to know when they are using the computer. I figure logins have to be logged SOMEWHERE, right? I tried looking at some of the logs in /private/var/log/ and didn't find anything, but some logs like system.log seem to be overflowing with redundant information. Anybody know what specific lines (or better yet a regexp so I can pipe it through grep) to look for?
 
Just use the last command in the terminal. This checks the /var/log/wtmp for all logins that are in that file (which should be for the current month, if the computer is being left on and the automatic monthly clean-up tasks are being run). To check for a specific person with the username "frank", you can type

last frank

and this will give the information for that specific person. You can also look at the past n times with the -n command. For example

last -5

shows the most recent 5 entries. These can be combined so that I can check the past five reboots and shutdowns with

last -5 reboot shutdown

If your mother doesn't want to deal with the Terminal.app, you can get OSX PowerAddOns Lite from VersionTracker, and then write a small AppleScript that runs the command and passes it along.
 
Thanks a lot, I can't wait to really start getting to know BSD and more specifically what constitutes Darwin, old-school BSD stuff, and Aqua. I just ordered my 512m RAM chip so I can switch to OS X full time once 10.1 hits the shelves :)
 
Red Phoenix,

Thanks for the great tip! The last command is one that I haven't run across in any of the *nix guides I've used. That will be very handy when I have users that I have migrated to X.
 
Back
Top