History Meme

   By chris on April 16th 2008 in /dev/random | 921 views

Jumping on the shell command history meme:

history|awk '{a[$2]++} END{for(i in a){printf “%5d\t%s \n”,a[i],i}}’|sort -rn|head
   97	ruby
   64	cd
   45	telnet
   43	ss
   27	sudo
   25	ping
   25	mysql
   18	ll
   16	svn
   11	script/generate

Too much playing in Ruby, I think!

Interestingly, this variant:

history|awk '{print $2}'|sort|uniq -c|sort -rn|head

Produces a slightly different count for Ruby:

  95 ruby
  64 cd
  45 telnet
  43 ss
  27 sudo
  25 ping
  25 mysql
  18 ll
  16 svn
  11 script/generate

Tag, you’re it.

3 Responses to “History Meme”

  1. Sam Roberts responded on 17 Apr 2008 at 10:46 pm #

    Its different in each of my sessions, but this is typical.

    history 1 | ruby -e ‘h=Hash.new(0); while gets; h[$_.split[1]]+=1 end; h.map{|k,v| [v,k]}.sort.reverse.each{|v,k| puts “%4d %s”%[v,k]}’

    108 ruby
    51 vi
    51 svn
    49 make
    32 ls
    30 qri
    26 clear;
    18 recur
    15 cd
    14 irb
    10 pwd
    9 m
    8 rcov
    8 open
    7 find
    6 zip
    5 curl
    5 #

  2. Bash history - a geek meme | Bloggy Hell responded on 18 Apr 2008 at 5:49 am #

    [...] was browsing through some ruby blogs and came across this crazy meme - shell command history [...]

  3. Briefly Noted for June 12, 2008 responded on 12 Jun 2008 at 4:13 am #

    [...] meme: Command line history. For about a month during the spring, geeks everywhere were using history|awk ‘{a[$2]++} [...]

Trackback URI | Comments RSS

Leave a Reply