The guys on Planet Mozilla have been posting something to their blogs which at first seemed really inane, but I found myself enjoying. I won’t even tell you what it is, simply post my version, and those of you who get it will get it, and those who don’t get it probably don’t even want to know.
topher@boktor:~$ uname -a
Linux boktor 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux
topher@boktor:~$ history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
92 cd
82 ls
60 vi
31 sudo
25 rm
13 grep
12 more
10 whois
10 scp
10 killall
Update:
Josiah’s question about killall (no I don’t really use it all that often) made me realize that I rarely do much in the shell on my local box. I almost always ssh someplace else and work there. So here’s one from an account I work on often, using pcg’s cooler version.
[wcsg@ireland ~]$history | awk '{print $2}' | sort | uniq -c | sort -nr | head
327 vi
322 cd
190 ls
60 cp
29 grep
15 rm
8 ncftp
8 mv
8 mkdir
5 pwd
Huh. That is cool. Here is mine:
53 ls
43 apt-get
37 exit
35 cd
27 rmmod
24 cat
22 modprobe
21 vim
21 mount
18 /etc/init.d/ipw3945d
I wonder what the numbers mean.
I’ve always preferred:
history | awk ‘{print $2}’ | sort | uniq -c | sort -nr | head
to the point that it’s second-nature to type it. (Mostly because I dislike awk programming.) Besides, my way is WAY more Unix-y, as it employs many small tools, rather than one bulky tool. 😉
pcg:~ pcg$ uname -a
Darwin pcg.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386 i386 i386
pcg:~ pcg$ history | awk ‘{print $2}’ | sort | uniq -c | sort -nr | head
315 ssh
29 cd
26 ll
13 cat
12 traceroute
11 open
10 scp
10 ps
8 sftp
8 history
The numbers simply count how many times a command shows up in your history.
Topher, you have a runaway prog that you have to kill regularly?
Looks like pcg has a love for all things SSH. 🙂
From my Mac (where I spend less time in cli):
72 ls
53 ruby
48 awk
39 sudo
29 vim
27 cd
27 ../convert.rb
18 sed
14 less
13 ping
My convert.rb is a script that takes a list of files and renames them according to their MD5hash, providing an sufficiently obscure name that people won’t just happen across them. The script then outputs a directory that gets added to a larger text file directory. It is a very simplistic file sharing security, well… obscurity, thing. 🙂
Topher!! I finally understood something you said (posted), the first time, without you explaining it to me!!!
111 cd
86 scp
64 ls
48 vi
35 ssh-add
25 ps
16 killall
11 sudo
10 vpn
9 whois
87 sudo
59 cd
53 ls
43 ifconfig
24 man
21 locate
15 exit
12 ping
10 less
6 top
and mine…
skyhawk:~ rhornsby$ history | {…}
117 ssh
56 ifconfig
46 ls
42 cd
36 ping
19 arp
18 host
16 scp
15 tar
15 sudo
rhornsby@tinman:~$ history | {…}
166 sudo
34 ls
34 cd
30 ifconfig
28 ping
25 route
17 exit
14 arp
12 tail
12 host