using grep with history:
$ history|wc 1000 3792 23858 $ history|grep ls|wc 161 425 2066 $ history|grep cd|wc 72 212 1225 $ history|grep wc|wc 68 306 2115 $ history|grep grep|wc 133 595 4133