history|awk ‘{print $2}’|awk ‘BEGIN {FS=”|”} {print $1}’|sort|uniq -c|sort -r
Very interesting review of the most often used commands on your *NIX machine. Here is my list
195 pico
131 cd
102 ls
58 uptime
47 exit
38 ps
34 clear
32 mytop
27 /etc/init.d/httpd
26 /etc/init.d/mysqld
23 tail
23 cat
22 mysql
20 sh
If you run a lot of homemade scripts (or even aliases), then the list unfortunately doesn’t mean as much (assuming you are just interested in proper *NIX commands.)
Here are mine, though:
389 vi
283 cd
45 ls
41 vrefs
15 grep
15 make
14 sync
13 uptime
10 df
9 less
9 gen_banrules.sh
9 banip
8 finger
7 tail
7 man
7 date
6 rm
6 pwd
6 mysqldiff
Also, a small change to the script (to sort reverse numeric):
history|awk ‘{print $2}’|awk ‘BEGIN {FS=”|”} {print $1}’|sort|uniq -c|sort +0 -1 -rn | less
Cheers.
Scott
If you run a lot of homemade scripts (or even aliases), then the list unfortunately doesn’t mean as much (assuming you are just interested in proper *NIX commands.)
Here are mine, though:
389 vi
283 cd
45 ls
41 vrefs
15 grep
15 make
14 sync
13 uptime
10 df
9 less
9 gen_banrules.sh
9 banip
8 finger
7 tail
7 man
7 date
6 rm
6 pwd
6 mysqldiff
Also, a small change to the script (to sort reverse numeric):
Change the last sort call to: sort +0 -1 -rn
Cheers.
Scott
cat .zsh/history | sed -r 's/([^[:space:]]+).*/\1/' | sort | uniq -c | sort -nr | less
378 cd
215 mplayer
214 rm
181 ls
153 less
145 sudo
116 grep
107 svn
89 mv
83 man
55 unrar
51 emacs
48 mkdir
36 mubase
35 vlc
33 cat
27 tar
22 dpkg
20 unzip
18 find
16 apt-cache
14 tail
13 killall
13 chmod
12 echo
12 aptitude
10 zgrep
10 perldoc
10 cp
For zsh:
cat .zhistory | sed -r 's/([^[:space:]]+).*/\1/' | sort | uniq -c | sort -nr | less
378 cd
214 rm
181 ls
153 less
145 sudo
116 grep
107 svn
89 mv
83 man
55 unrar
51 emacs
48 mkdir
36 mubase
35 vlc
33 cat
27 tar
22 dpkg
20 unzip
18 find
16 apt-cache
14 tail
13 killall
13 chmod
12 echo
12 aptitude
10 zgrep
10 perldoc
10 cp
$ history|awk ‘{print $3.17 ($2)}’|awk ‘BEGIN {FS=â€|â€} {print $1.58 ($1)}’|sort|uniq -c|sort -r
bash: syntax error near unexpected token `('
Am I doing something wrong?
Ketsugi,
take the <code> out of the statement.
On my laptop it’s:
65 mv
64 wget
53 exit
48 cd
21 mkdir
20 .
19 ssh
19 ls
15 ~/wpdb
14 sudo
9 sync
9 svn
9 ping
9 netstat
9 mysqldump
9 history
8 ./refresh-wordpress
7 ~/refresh-wordpress
7 ps
7 du
On my server (as me) it’s:
181 exit
174 su
84 cd
71 mysql
70 ls
40 ps
38 epsilon
33 uptime
30 pwd
27 wget
25 top
15 .
13 tar
13 mv
13 cp
11 mysqladmin
10 du
9 lynx
9 df
8 users
and on my server (as root) it’s:
190 ls
138 cd
69 exit
65 epsilon
54 cp
43 chown
37 mv
27 ps
26 hostname
26 .
24 mysql
23 chmod
22 tar
20 find
19 pwd
15 unzip
15 du
14 sudo
14 rm
13 chgrp