First of all, this is not a duplicate of any existing threads on SE. I have read these two threads (1st, 2nd) on better bash history, but none of the answers work - - I am on Fedora 15 by the way.
I added the following to the .bashrc
file in the user directory (/home/aahan/), and it doesn't work. Anyone has a clue?
HISTCONTROL=ignoredups:erasedups # no duplicate entries
HISTSIZE=1000 # custom history size
HISTFILESIZE=100000 # custom history file size
shopt -s histappend # append to history, don't overwrite it
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" # Save and reload the history after each command finishes
Okay this is what I want with the bash history (priority):
- don't store duplicates, erase any existing ones
- immediately share history with all open terminals
- always append history, not overwrite it
- store multi-line commands as a single command (which is off by default)
- what's the default History size and history file size?
echo $SHELL
). Do the settings work if you run them manually from your open shell? Obviously since they do work for so many others the settings are right, you are just implementing them wrong. And no Fedora15/Gnome3/being a virtual machine have little to do with the actual function ofbash
. – Caleb Aug 08 '11 at 20:08.bashrc
file. Is that wrong? Can you add an "answer" to this post with the actual shell commands? (please bear with my noob-ity.) – its_me Aug 08 '11 at 20:25.bashrc
ARE actual shell commands. Scripts are just series of shell commands. Also the edit you recently made removing theexport
bit was a bad idea, that should be kept. – Caleb Aug 08 '11 at 20:47export HISTCONTROL=ignoredups:erasedups
a command that should be implemented in shell? If so, I think I tried that multiple times. No changes have taken place in the.bashrc
file. (isn't that where I should be looking?) – its_me Aug 08 '11 at 20:52