Loading

Enabling bash history and more

After reading the tip I mentioned in my previous post I made some changes to my `~/.bashrc` to enable bash history

alias e32="$HOME/eclipse/eclipse321/eclipse"
alias e33="$HOME/eclipse/eclipse33M4/eclipse"
alias nb="$HOME/netbeans-5.5/bin/netbeans"
 
JAVA_HOME=$HOME/jdk1.6.0
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:
 
export PATH
HISTFILESIZE=1000000000
HISTSIZE=1000000
HISTCONTROL=ignoredups 
shopt -s histappend
INPUTRC=~/.inputrc

and to my `~/.inputrc`

# .inputrc
# "\e[A" and "\e[B" being whatever your terminal uses for up & down.
"\e[A": history-search-backward
"\e[B": history-search-forward

And with the following simple command I can see the commands I use most:
cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 30

One Trackback

  1. [...] all the combined history files. Otherwise you’ll lose some of the entries. You can go to this post for reference on how to change the history file [...]

Post a Comment

Your email is never shared.