fREWdiculous!
5 Apr
Yesterday Ovid posted this little snippet to get his top 10 used commands.
I had to modify it a little for my zsh settings:
1 2 3 4 5 6 7 8 9 10 11 | valium [4030] ~acd % history -n 1 | awk {'print $1'} | sort | uniq -c | sort -k1 -rn | head 1336 svn 419 perl 301 git 245 rm 233 cd 179 vi 151 ack 67 sudo 62 cpan 61 mv |
I’m sure that my home computer would have the git and svn switched. I’ll update this post with that computer’s history if I remember.
update Here’s my home computer:
1 2 3 4 5 6 7 8 9 10 11 | FrewSchmidt2 [10021] ~ % history -n 1 | awk {'print $1'} | sort | uniq -c | sort -k1 -rn | head 1917 git 981 rm 831 perl 801 vi 795 cd 344 ls 327 svn 289 sudo 233 mv 201 cp |
One Response for "commands!"
I don’t know what shell you’re using, but the -n 1 option to history gives me nothing in bash. I used the following command:
history | awk ‘{print $2}’ | sort | uniq -c | sort -rn | head
Leave a reply