Most Used Commands

Andy Bradford amb-plugg at bradfords.org
Tue Jun 25 23:23:27 MDT 2013


Thus said "Ryan Simpkins" on Tue, 25 Jun 2013 22:18:29 -0600:

> Look at that. Joseph has percentages. You Perl guys are always showing
> off. ;-)

How do you know he didn't do it with awk? (besides the fact that this is
Joseph Hall we're talking about :-)

$ fc -l 1 | awk '{ a[$2]++ } END { for (b in a) printf("%8d %8.2f%% %10s\n", a[b], 100 * a[b] / NR, b) }' | sort -k 1r | head -10
     153    32.83%     authpf
      60    12.88%       exec
      28     6.01%      whois
      26     5.58%        ssh
      24     5.15%       tmux
      20     4.29%       lynx
      18     3.86%         ls
      13     2.79%  sntpclock
      13     2.79%        awk
      12     2.58%         cd

Yes, I left the line count off, but it would be trivial to add.

Andy
-- 
TAI64 timestamp: 4000000051ca7af2




More information about the PLUG mailing list