2 ms·
Going off a comment on the article, using mainly awk to find your commands, I expanded it a little bit, as most commands I use take a first argument that change
by shakna 10y ago
Going off a comment on the article, using mainly awk to find your commands, I expanded it a little bit, as most commands I use take a first argument that changes how it works. (Aliasing this command might not be a bad idea.)
history | awk '{print $1 "__-__" $2}' | sort | uniq -c | sort -rn | head -30 | awk '{gsub("__-__", " ", $2); $2} !max{max=$1;}{r="";i=s=100*$1/max;while(i-->0)r=r"#";printf "%50s %5d %s %s", $2, $1, r, "\n";}'
It produces a histogram of the 30 most frequent used commands.
Unsurprisingly for me, `git commit` was first. Kinda surprisingly, `apt-get` was third.
Caveat: I convert spaces to the symbol sequence: __-__ and back. If your command includes that symbol sequence, it'll break something.