mark@atlantis:~% uname -a
Linux atlantis 2.6.23.9 #1 SMP Sun Dec 2 22:09:17 EST 2007 x86_64 GNU/Linux

mark@atlantis:~% history -1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
181 cd
167 ls
103 sudo
75 rm
42 lsdvd
40 fp
39 mv
38 ll
37 cat
24 mkdir

And root:

atlantis:~# history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
25 mount
20 aptitude
15 cd
11 ls
5 iwconfig
5 exit
5 dpkg
5 df
4 module-assistant
4 cat

Notes:

(I’ve seen this meme sweep through Planet Intertwingly like a bad rash, but Ben’s post is what finally prompted me to participate. In proper meme fashion, I tag Joe and Tim to go next.)

§

Twenty three comments here (latest comments)

  1. [~]$ cat .zsh_history | awk \’{a[$1]++}END{for(i in a){print a[i] \” \” i}}\’ | sort -rn | head
    892 python
    424 vi
    400 cd
    380 less
    372 sudo
    360 exit
    230 ls
    203 git
    137 man
    136 pydoc

    This is technically not the command you used, but history -1000 didn\’t work that well on my zsh, for some reason. You\’d _never_ guess it from these results, but I\’m a Python programmer…

    — Pianohacker #

  2. I think WordPress may have screwed up the quotes in the latter part of the awk statement?

    — Stef Pause #

  3. history -1000 gives me an error.
    here’s what i had to do to make it work in bash:

    history 1000 | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head

    i sadly can’t take part in this meme, since i symlink my ~/.bash_history to /dev/null and have a `history -c` line in my .bash_logout.

    i almost wish i didn’t now =)

    — jason #

  4. lucasjosh.com » Blog Archive » Shell History (pingback)
  5. awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’

    Isn’t “awk ‘{print $2} |sort |uniq -c”, besides being easier to type, much clearer? I suppose we may not be going for clear here…

    — daveadams #

  6. History meme at Blip Bloop (pingback)
  7. tecosystems » Well, Everyone Else Was Doing It (pingback)
  8. SickBiscuit : command line history - me too (pingback)
  9. Eponymous Blog > History (pingback)
  10. Dwelling » History meme (pingback)
  11. History Meme | SYP (pingback)
  12. Binary Code » History Meme (pingback)
  13. History Meme — Блог Макса Ищенко (pingback)
  14. History meme | Notes from a messy desk (pingback)
  15. Mess of Pottage › command history (pingback)
  16. History Meme « Shebanation (pingback)
  17. Atlantis is the hostname for my linux box as well.

    — erichmj #

  18. Command history meme | redemption in a blog (pingback)
  19. Bash history - a geek meme | Bloggy Hell (pingback)
  20. $ history | awk ‘{print $2}’ | sort | uniq -c | sort -rn | head
    245 perl
    227 cd
    209 ls
    161 make
    80 perldoc
    60 bb
    41 sudo
    39 release
    37 l
    35 svn

    Some notes:

    bb is more alias for invoking bbedit from the command line
    release is my software release automation program (found in the Perl module Module::Release)
    l is a shortcut for logging out of the session

    Looking through .bash_history instead gives a different picture.

    $ cat ~/.bash_history | awk ‘{print $1}’ | sort | uniq -c | sort -rn | head
    145 perl
    117 cd
    96 ls
    47 git
    42 sudo
    33 make
    33 bb
    27 perldoc
    21 hm
    17 ./configure

    — brian d foy #

  21. 97 ls
    82 cd
    46 mplayer
    42 make
    33 sudo
    30 ./driver
    20 vim
    15 lame
    12 ./test.sh
    12 gedit

    — SFX #

  22. It’ll Never Fly » Decksandrumsandrockandroll, Track #6 (pingback)
  23. History Meme : (pingback)

Respond privately

I am no longer accepting public comments on this post, but you can use this form to contact me privately. (Your message will not be published.)



§

firehosecodeplanet

© 2001–9 Mark Pilgrim