2

I would like to know when I logged in and out on my mac.

Is it possible?

2

Open up a terminal and enter the command: last

chris@chriss-mbp-2:~/Documents/dev/git/$ last

    chris     ttys005                   Sun Dec 22 01:51 - 02:57  (01:06)
    chris     ttys005                   Sun Dec 22 01:50 - 01:51  (00:00)
    chris     ttys004                   Sat Dec 21 13:32 - 19:53 (1+06:20)
    chris     ttys003                   Sat Dec 21 13:32   still logged in
    chris     ttys002                   Sat Dec 21 13:32   still logged in
    chris     ttys001                   Sat Dec 21 13:32   still logged in
    chris     ttys000                   Sat Dec 21 13:32   still logged in
    chris     console                   Sat Dec 21 13:32   still logged in
    reboot    ~                         Sat Dec 21 13:32 
    shutdown  ~                         Sat Dec 21 13:32

Further details about last can be found in the man pages here.

  • It does not work as I expect. I'm log until ca. 15min and I get this only one line for today: charles ttys000 Tue Dec 24 11:27 still logged in. The date command prints "Tue Dec 24 11:27:02 CET 2013". – Charles Dec 24 '13 at 10:30
  • @charles could you please explain what you are exactly trying to accomplish? It's not quite clear from your question as it's very brief. – Chrisii Dec 24 '13 at 12:32
  • I want to track how long I worked every day. e.g. [08:05] Login, [12:20] Logout (launch) [13:35] Login, [19:05] Logout (back at home). – Charles Dec 26 '13 at 11:25
  • Actually I would like to also track locked screen. – Charles Dec 26 '13 at 22:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .