dive into mark

You are here: dive into markArchivesApril 2008History meme

Tuesday, April 15, 2008

History meme

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.)

Filed under , ,

23 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…

    Comment by Pianohacker — Tuesday, April 15, 2008 @ 12:37 pm

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

    Comment by Stef Pause — Tuesday, April 15, 2008 @ 1:17 pm

  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 =)

    Comment by jason — Tuesday, April 15, 2008 @ 2:25 pm

  4. Pingback by lucasjosh.com » Blog Archive » Shell History
  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…

    Comment by daveadams — Tuesday, April 15, 2008 @ 8:37 pm

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

    Comment by erichmj — Thursday, April 17, 2008 @ 8:53 pm

  18. Pingback by Command history meme | redemption in a blog
  19. Pingback by Bash history - a geek meme | Bloggy Hell
  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

    Comment by brian d foy — Friday, April 18, 2008 @ 10:08 am

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

    Comment by SFX — Sunday, April 20, 2008 @ 5:33 pm

  22. Pingback by It’ll Never Fly » Decksandrumsandrockandroll, Track #6
  23. Pingback by History Meme :

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.)



Recent Stuff For You, Special Price Stay Here
  • Greasemonkey Hacks
Good Stuff Buy The Cow Go Away
Dive Into Python
Powered by Google Drink The Milk Don't Steal

 

posts / comments
© 2001-8 Mark Pilgrim