You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
misc/shell_scripts/most_used_commands

18 lines
947 B

#! /usr/bin/env bash
AVOID="con\|utopiah@benetou.fr"
# TODO
# consider similar usage for more than bash
# find ~ -name "*history*"
# ~/.vimperator/info/default/history-command (specific JSON format)
# ~/.newsbeuter/history.cmdline
# code repository per programming language (PHP, Processing, JavaScript, ... and bash too!)
# thought about this earlier to compare with the "signature" vocabulary of expert, notes unfound
echo consider also http://fabien.benetou.fr/Tools/ and to do exercises
# warning, do not miss the environment e.g. http://mywiki.wooledge.org/BashGuide/
cat ~/.bash_history | sed "s/ /\n/g" | grep "^[[:alpha:]]" | sort | uniq -c | grep -v $AVOID | sort -n | tail | sed "s, \([a-zA-Z].*\), \1\t( http://unixhelp.ed.ac.uk/CGI/man-cgi?\1 ) ,"
# simpler version for just the first word, which is bad for commands like sort which never appear first
#cat ~/.bash_history | sed "s/ .*//" | sort | uniq -c | sort -n | tail