Ruben Laguna’s blog

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

1
2
3
4
5
6
7
8
9
10
11
12
13

1
2
3
4
5
6
7
8
9
10
11
12
13
<span class='line'>alias e32="$HOME/eclipse/eclipse321/eclipse"
</span><span class='line'>alias e33="$HOME/eclipse/eclipse33M4/eclipse"
</span><span class='line'>alias nb="$HOME/netbeans-5.5/bin/netbeans"
</span><span class='line'>
</span><span class='line'>JAVA_HOME=$HOME/jdk1.6.0
</span><span class='line'>PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:
</span><span class='line'>
</span><span class='line'>export PATH
</span><span class='line'>HISTFILESIZE=1000000000
</span><span class='line'>HISTSIZE=1000000
</span><span class='line'>HISTCONTROL=ignoredups 
</span><span class='line'>shopt -s histappend
</span><span class='line'>INPUTRC=~/.inputrc</span>

and to my `~/.inputrc`

1
2
3
4

1
2
3
4
<span class='line'># .inputrc
</span><span class='line'># "\e[A" and "\e[B" being whatever your terminal uses for up & down.
</span><span class='line'>"\e[A": history-search-backward
</span><span class='line'>"\e[B": history-search-forward</span>

And with the following simple command I can see the commands I use most:

1

1
<span class='line'>cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 30</span>

Comments

Copyright © 2015 - Ruben Laguna - Powered by Octopress