Wednesday, October 3, 2012

History command

play command show history and count command used

example:
# history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n",a[i],i}}'|sort -rn|head


mytotoe@MyTOTOE-PC ~ $ history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n",a[i],i}}'|sort -rn|head
    5 sudo
    4 top
    2 exit
    1 vim
    1 reboot
    1 history|awk
mytotoe@MyTOTOE-PC ~ $