Is there any way, such as an application or a terminal command, to display a log of every application that has been running on the computer? A bit like a keylogger, but for applications instead of keyboard. I did not find anything on the internet.

If it does not exist, do you think that programming such a tool would be possible?

Thank you for your help

1 Answer 1


There is an application called Time Sink ($5, free trial available) which can track time spent in an application in the foreground. I believe it also tracks background time too.

For a native and more techy solution, you can run this terminal command:

top -d 5 -b > /var/log/top.txt

This command will run top every 5 seconds as defined by -d, -b is for batch mode and this is used for sending output to a file. You wouldn't want to have this running all the time unless you're compressing the log file or using logrotate, as the log file would get large.

  • Thank you ! What is logrotate? Is it better to use it or to compress the file? And how to compress it automatically?
    – Sithered
    Mar 18, 2016 at 22:19
  • @MarinD Logrotate is a unix utility program used to, well, rotate logs. :) It can also handle automatic compression of old files. Rackspace has a good support page showing sample configurations.
    – ghoppe
    Mar 21, 2016 at 14:45

You must log in to answer this question.

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