Skip to content

Instantly share code, notes, and snippets.

@citizen428
Created May 25, 2009 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save citizen428/117571 to your computer and use it in GitHub Desktop.
Save citizen428/117571 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
results = Hash.new(0)
`awk '{print $1}' ~/.bash_history`.split.each { |c| results[c] += 1 }
results.sort_by { |e| -e[1] }.each { |k, v| puts "#{k}: #{v}" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment