Check programs used most

How can you check the programs that you use most often?

I don't know of any UNIX OS that keeps, by default, track of that statistic. Might be different if there are any auditing tools active (eg. AppArmor or SELinux), and the Window Managers might keep statistics of what they started, but that's very specific.

you can write a specific script that you want to track which program ran and what is the in time..

for exa

/etc/init.d/cron.d

you can add an extra line to start function end

......
...........
case "$1" in
  start)
        start
if [ $? = 0 ] ; then
printf "%s\n" "in $(/bin/date) $prog daemon starting" >> /usr/local/bin/daemontracks1
else
printf "%s\n" "in $(/bin/date) $prog daemon tried to start but fail attempt" >> /usr/local/bin/daemontracks1
fi
;;
  stop)
............
....................

There is a standard unix package called "System Accounting". See "man 1m acct". It includes Process Accounting. It is a significant chore to set up and on a busy system creates very large data files ... but it can be worth the effort expecially if you buy a 3rd party presentation package.

Would I also wanna put this in crontab?

Is this compatible with ubuntu? I didn't see it in the repository.

No for use crontab maybe different method..This code is appended in service scripts..
for Crontab usage you may another script for exa
this script must run every one minute and check the
like this

 
pid=`cat /var/run/somedaemon
lasptpid=$pid ; 
count=0
if [ `ps -p $pid -o comm=` ] ; then 
echo "active and still running"; else echo "daemon is not running" 
if [ $lastpid != $pid ] ; then "echo new daemon start" ; let count=$count+1 ;else echo "process still running" ; fi; fi
a=$count+$a
echo `ps -p $pid -o comm=` daemon $a times started 

If you are not running unix it can be confusing posting questions in a unix forum. No idea whether Ubuntu Linux has unix System Accounting but I doubt it.